Why durable subscription can have only one active subscriber at a time

547 Views Asked by At

From official doc

At the cost of higher overhead, you can use the Session.createDurableSubscriber method to create a durable subscriber. A durable subscription can have only one active subscriber at a time

Can you explain why design was chosen so?

From my point of view topic was invebted especially for situation when we have a lot of subscribers.

1

There are 1 best solutions below

8
Shashi On

A topic can have any number of subscribers, durable and non-durable. Each subscriber will get a copy of the message published. So you need to create lot of subscriptions when you have lot of subscribers.

If there are more than one subscribers sharing the same subscription, then publications will be distributed among them. So only one of the subscriber will get the publication, not all.

A durable subscription is one where publications are sent to the subscriber's queue even if the subscribing application is offline. Those messages are delivered once the application comes online.