Java Reference
In-Depth Information
Figure 14.3. Overview of the support bulletin
The bulletin endpoint is implemented using the annotation approach. This means that the
lifecycle and message-handling functionality is handled by one object. Updates from the
ChatServer are published to all BulletinService endpoints using a JMS topic.
Broadcast messages sent by one CSR to the bulletin are published to the same JMS topic.
JMS is used instead of CDI events, because in a load-balanced environment, the Bullet-
inService instances will be spread out across multiple servers. All messages sent via
WebSockets use JSON. Now that you have a handle on how WebSockets are used in Ac-
tionBazaar, let's turn our attention to the chat service and see how it's implemented using a
programmatic endpoint.
14.4.1. Using programmatic endpoints
As we've mentioned, there are two approaches to creating an endpoint: programmatic and
annotated. In this section we'll discuss the programmatic endpoint. Although it sounds
complicated, programmatic endpoints aren't more complicated than annotated endpoints.
 
Search WWH ::




Custom Search