Question

I have a topic. I have 10 consumers subscribed for it. As per my understanding, message will be removed from topic till all consumers have received it. Right? Once it is removed, any further subscriber will not notified for that specific message. I could not confirm it in JMS specification anywhere.

Was it helpful?

Solution

A broker (in your case Active MQ) will deliver a publication to all active subscribers, both durable and non-durable (meaning consumer applications which are running when a publication was made on a topic and consuming messages and any durable subscribers which are not active). The broker will then discard the publication. If there are no active subscribers or durable subscribers for a topic, the broker will discard the publication immediately. It will not wait for any subscribers to become active. The only exception is in the case of "Retained Publication" option being exercised, where the broker will cache a publication and deliver to consumers who may arrive later. But note that broker will not wait for all consumers to receive publication before removing it from a topic. I would say there is nothing like 'removing from topic'.

Hope I am clear.

OTHER TIPS

Only active subscribers will get your message in that case, after that your message is removed. If you want to send your message also to inactive subscribers you can configure durable subscription.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top