tags:

views:

178

answers:

1

Hello.

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?

+1  A: 

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

nos
Exactly what I need. Thanks.Don't you know could I use selectors with AMQ+AJAX on client side? (e.g. in javascript, when I'm subscribing to some channel/topic using: amq.addListener('autobids', 'topic://se.minutauktion.autobids', root.onAutobid);
archer
All I can see is the QueueBrowserServlet extracts a "selector" parameter, so I'm guessing you can use a selector=xxx query parameter in the ajax calls.
nos
Great! Thank you!
archer
I would like to add that while Selectors on a functional level may add what you need, you should do performance tests. i don't know what level of performance you require but i have noticed that in larger setups where high performance is required, selectors quickly start being a bottleneck...
Noctris