Java Reference
In-Depth Information
The JMS specification goes one step further: It provides common interfaces that enable
you to use the JMS API in a way that is not specific to either domain. The following sub-
sections describe the two messaging domains and the use of the common interfaces.
Point-to-Point Messaging Domain
A point-to-point (PTP) product or application is built on the concept of message queues ,
senders, and receivers. Each message is addressed to a specific queue, and receiving cli-
ents extract messages from the queues established to hold their messages. Queues retain
all messages sent to them until the messages are consumed or expire.
PTP messaging, illustrated in Figure 20-3 , has the following characteristics:
• Each message has only one consumer.
• A sender and a receiver of a message have no timing dependencies. The receiver
can fetch the message whether or not it was running when the client sent the mes-
sage.
• The receiver acknowledges the successful processing of a message.
FIGURE 20-3. Point-to-Point Messaging
Use PTP messaging when every message you send must be processed successfully by one
consumer.
Publish/Subscribe Messaging Domain
In a publish/subscribe (pub/sub) product or application, clients address messages to a top-
ic , which functions somewhat like a bulletin board. Publishers and subscribers are gener-
ally anonymous and can dynamically publish or subscribe to the content hierarchy. The
system takes care of distributing the messages arriving from a topic's multiple publishers
to its multiple subscribers. Topics retain messages only as long as it takes to distribute
them to current subscribers.
Search WWH ::




Custom Search