qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fraser Adams <fraser.ad...@blueyonder.co.uk>
Subject Re: All Fruit Except Peaches (aka: "not" expressions in binding keys)
Date Fri, 30 May 2014 07:06:56 GMT
On 29/05/14 21:06, Chris Richardson wrote:
> Hi,
>
> Back in Sept 2011 Frase and Gordon had a discussion concerning negative
> expressions in binding keys (
> http://mail-archives.apache.org/mod_mbox/qpid-users/201109.mbox/%3C4E647F62.5020205%40redhat.com%3E
> )
>
> The conclusion was that it's not possible and that an xml exchange might
> provide the required functionality.
>
> I would like this feature for a topic exchange (the discussion above
> concerned specifically header exchanges) and wonder if the situation is
> still the same? I have not been able to find any other trace of this being
> done/documented.
>
> Failing the option of negative matching, a workaround I can think of is to
> route all messages to a "triage" topic exchange, read all messages I
> _don't_ want to a queue which will simply discard them, then use the
> "alternate_exchange" option to route any remaining messages (the ones I
> want) to another exchange where they can be managed as required... however
> this setup seems a bit of a kludge.
>
> Many thanks
>
> Chris
>
Hi Chris,
The situation has change somewhat for the better. As of Qpid 0.20 (I 
think) the concept of Message Selectors was introduced to Qpid. If you 
are familiar with JMS then it's pretty much an implementation of the JMS 
Message Selector specification, but it applies to qpidd and the Java 
Broker and works for all the qpid clients not just JMS (so you can use 
it with C++ apps too).

The filters are applied broker side and in conjunction with any exchange 
too so you can have very sophisticated filtering, for example you could 
publish to a topic exchange and subscribe to different subjects and 
apply different filters on top of that if you so choose.


There's currently not a vast amount of documentation, so I've attached a 
write up of my own experiments that I did whilst trying to get my head 
around the differences between AMQP 0.10 and AMQP 1.0 most of this 
relates to AMQP 1.0, but selectors will work with 0.10 too - though the 
syntax would be the same, that is to say selectors are applied as 
filters on the link configuration.

The second thing I attached might be interesting too. A chap called 
Clive posted a little while back trying to subscribe to different topics 
off a single queue, in general you can't do that - you normally have 
subscription queues following an exchange binding, however with message 
selectors because they are related to the links you can actually achieve 
this (though it's not something I'd personally do).


The attached documents are pretty long, but hopefully they should give 
you everything you need and more. I really need to make some time to 
make the info more coherent and publish it properly - it'd be great if 
you could let me know if it turns out to be useful - or if it's just TL;DR

HTH,
Frase



Mime
View raw message