Java Reference
In-Depth Information
Figure 20-6 and Figure 20-7 show the difference between a nondurable and a durable sub-
scriber. With an ordinary, nondurable subscriber, the subscriber and the subscription begin
and end at the same point and are, in effect, identical. When a subscriber is closed, the sub-
scription also ends. Here, create stands for a call to Session.createConsumer
with a Topic argument, and close stands for a call to MessageConsumer.close .
Any messages published to the topic between the time of the first close and the time of
the second create are not consumed by the subscriber. In Figure 20-6 , the subscriber
consumes messages M1, M2, M5, and M6, but messages M3 and M4 are lost.
FIGURE 20-6. Nondurable Subscribers and Subscriptions
FIGURE 20-7. A Durable Subscriber and Subscription
With a durable subscriber, the subscriber can be closed and re-created, but the subscription
continues to exist and to hold messages until the application calls the unsubscribe
method. In Figure 20-7 , create stands for a call to Ses-
sion.createDurableSubscriber , close stands for a call to MessageCon-
Search WWH ::




Custom Search