Archer
Archer

Reputation: 5147

ActiveMQ - sending message to specific consumer

Having single AMQ broker and 100 consumers connected. I would send the message to some specific consumer, so other consumers does not receive it (client-side filtering won't work).

Simplest way is to create virtual destinations (name them queue:consumer-) for example and send messages there. However this will lead to 100 new queues which makes it more complex to monitor. Is there any other way to do this having single queue?

Upvotes: 5

Views: 6247

Answers (1)

nos
nos

Reputation: 229108

You could use JMS selectors.

You would designate a unique id to each of your consumers, the producer would have to know about those ids to send only to a specific consumer. The consumers have to collaborate, and set a selector to receive only messages designated to its own id as well messages designated to all/any of the consumers

Upvotes: 9

Related Questions