12
votes

Please help me in understanding the Durable subscriptions in JMS, I am going through this link and came across the statement:

http://docs.oracle.com/javaee/1.3/jms/tutorial/1_3_1-fcs/doc/advanced.html#1024717

A durable subscriber registers a durable subscription with a unique identity that is retained by the JMS provider. Subsequent subscriber objects with the same identity resume the subscription in the state in which it was left by the previous subscriber. If a durable subscription has no active subscriber, the JMS provider retains the subscription's messages until they are received by the subscription or until they expire.

Is subscriber and durable subscriber are two different objects that exists at the same time? Also please help me what these statement mean?

1

1 Answers

31
votes

A subscriber (also known as a consumer) is an application that creates a subscription to receive publications (or messages) from desired topic(s).

There are two types of subscribers:

Non-Durable subscriber: This type of subscriber application will get publications from a messaging provider as long as the application is running. Once the application ends, the messaging provider removes the subscription.

Durable Subscriber: This is the second type of application which receive publications as long as they are running. When the application ends, the messaging provider will cache publications for the subscriber and deliver them when the application comes back.