On 06/05/2014 11:27 PM, Chris Wj wrote:
It seems that subject filtering with queues is not working in the current
qpid implementations. What is the recommended way to simulate this
behavior? I am used to AMQP 0.9.1 and I am very unfamiliar with creating
such filtering behavior with QPID. I would like to programmatically
establish queues and set it up so that receivers can specify a key/subject
that matches messages. I'm primarily using Python and would like to keep
things as cross platform as possible.

With the qpid.messaging API (which I assume is what you are using?), you can specify an address for your receiver in the form <exchange>/<key> and the library will create a queue for you and bind it to the specified exchange with the specified key.

So e.g. creating a receiver for 'amq.topic/abc' will then receive messages sent to amq.topic with the routing key being abc.

If you want you can control the 'subscription queue' created in more detail by specifying some link options.

E.g. 'amq.topic/abc; {link:{name:my-queue}}'

would mean the queue was given the name my-queue. Further you can specify details of the declare used to create the queue if needed.

E.g. 'amq.topic/abc; {link:{name:my-queue, x-declare:{auto-delete:False, durable:True}}}'

In these examples, the filtering is applied to messages coming through the exchange, before they are enqueued.

If on the other hand you use an address where the 'node' is a queue, i.e. <queue>/<key>, then for receivers the key will not have any effect with the current qpid.messaging. That pattern implies filtering by subject on the messages after the have been enqueued. [It is now supported by the c++ qpid::messaging (when used with qpidd, the c++ broker), but not by the python qpid.messaging equivalent.]



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

Reply via email to