Java™ Message Service API Tutorial and Reference: Messaging for the J2EE™ Platform
by Mark Hapner, Rich Burridge, Rahul Sharma, Joseph Fialli, Kim Haase
A.1. Durable Subscriptions
The DurableSubscriberExample.java program shows how durable subscriptions work. It demonstrates that a durable subscription is active even when the subscriber is not active. The program contains a DurableSubscriber class, a
MultiplePublisher class, a main method, and a method that instantiates the classes and calls their methods in sequence.
The program begins like any publish/subscribe program: The subscriber starts, the publisher publishes some messages, and the subscriber receives them. At this point, the subscriber closes itself. The publisher then publishes some messages while the subscriber is not active. The subscriber then restarts and receives the messages.
Before you run this program, create a connection factory ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access