Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveMQ - sending message to specific consumer

Tags:

activemq

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?

like image 765
Archer Avatar asked Mar 17 '10 09:03

Archer


Video Answer


1 Answers

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

like image 108
nos Avatar answered Jan 04 '23 02:01

nos