On 01/10/2014 09:15 AM, Fraser Adams wrote:
I'm much more familiar with qpid::messaging/JMS myself and I'd be quite
keen for some guidance on AMQP 1.0 Addressing and examples of say how to
write something in messenger that could publish or subscribe to things
that I'm familiar with - most of my current use cases publish to
amq.match - the default headers exchange and subscribe by using
x-bindings. Over time I'll migrate to message selectors, but in the
short term I'd love to know how to go about getting this stuff
interoperable.

At present messenger only sets the address of the source for receiving links and of the target for sending links. For sending/receiving to an existing queue or to a fanout exchange, this is all you need (just specify the queue or exchange name as the path in the url of the address used, e.g. amqp://127.0.0.1/my-queue or amqp://127.0.0.1/amq.fanout). That gives you the basic queue and topic patterns of JMS.

Binding a subscription to the headers exchange (or indeed even to topic or direct exchanges) with both qpid brokers requires using the 'legacy amqp' filters registered as extensions for 1.0. Likewise if specifying a jms selector. At present there is no way to set a filter on a source when using messenger however.

To migrate from using the headers exchange to using a selector while retaining the qpid::messaging API should be fairly straightforward. You just need to specify a 'selector' option in the link properties for your address, and use e.g. a fanout exchange instead.

e.g. drain -f "amq.fanout; {link:{selector:\"colour IN ('red', 'blue')\"}}"

then:
     spout amq.fanout -P colour=red
     spout amq.fanout -P colour=yellow

etc.

That gives you the same functionality as the headers exchange in (I think) a much simpler syntax, and works for both 1.0 (where it uses the registered jms filters extension) or 0-10 (or mixtures of the two).

You can use another exchange type as well of course, with additional filtering on subject distinct from the selector.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to