Search code examples
jms

JMS single dequeuing for topic


I have many subscribers listening to a topic, but only one subscriber get the message (dequeing) to process a task.

Can I go for a topic and non-durable subscribers?

Is the below statement correct:

A topic will normally deliver the message to the first consumer dequeuing, but if durable subscribers have subscribed to the topic, messages will be delivered to each one of them.

Or queue is a better solution? For me I think publish-subscriber is more simple solution.


Solution

  • A message sent to a topic should be delivered to every subscriber whether they are durable or not. Of course, this assumes the subscribers are using a blank selector or a selector that matches the message that was sent.