[rabbitmq-discuss] STOMP - Message queue selectors for consumers?

Michael Justin michael.justin at gmx.net
Tue Jun 7 12:07:37 BST 2011


Am 07.06.2011 06:20, Toby Corkindale wrote:
> Hi,
> I'm afraid I'm something of a beginner when it comes to message queuing
> systems, although I've submitted several patches to the Perl STOMP
> modules in the process of using them recently, and have picked up what I
> think is a bit of knowledge.
>
> Anyway, I have a query about RabbitMQ's STOMP plugin, and haven't quite
> been able to understand the docs on the matter.
>
> My goal is to have a queue where the consumers of that queue only
> receive a subset of all messages. I want them to filter based on a
> header in the messages.
>
> Eg.
>
> SEND
> destination:/queue/foo
> x-country:australia
>
> with the receiver somehow doing something like:
> SUBSCRIBE
> destination:/queue/foo?x-country=australia
>
>
> Now currently I can achieve this goal by creating lots of queues, one
> for each possible value, and then the consumers can subscribe to all the
> queues.. but this is a bit messy.
>
> Eg.
> SEND
> destination:/queue/foo.australia
>
> SUBSCRIBE
> destination:/queue/foo.australia
>
>
> There are some discussions of routing keys in the STOMP plugin's docs,
> but I don't understand how they relate. Are they what I'm looking for?
> I only want this to work with simple queues, not, as far as I know,
> exchanges. Maybe I'm barking up the wrong tree though?
>
> I note that in ActiveMQ's STOMP plugin, you can apply a selector to the
> subscription like this:
>
> SUBSCRIBE
> destination:/queue/foo
> activemq.selector:country="australia"
>
>

This is also documented in a broker independent way on 
http://stomp.codehaus.org/Stomp+JMS

"You can use an SQL 92 selector whenever you subscribe using the 
selector header

selector:location = 'London' and sex = 'M'


It is also supported by the Oracle Open Message Queue (OpenMQ) Stomp 
connector.

But the RabbitMQ Stomp plugin does not support the JMS+Stomp extensions 
like no-local, expires, persistent, priority, reply-to or 
durable-subscriber-name etc. AFAIK - but please correct me if I am wrong :)

Regards,
Michael Justin




More information about the rabbitmq-discuss mailing list