On 05/19/2011 03:53 PM, Rajith Attapattu wrote:
On Thu, May 19, 2011 at 10:04 AM, Gordon Sim<g...@redhat.com>  wrote:
On 05/19/2011 02:36 PM, qpid user 2 wrote:

So any input on this? I am trying to construct a header exchange
subscription using JMS. How would the destination and jndi properties look
like?

For python or c++ the following address is an example of what you want:

  my-headers-exchange;
{link:{x-bindings:[{arguments:{'x-match':all,a:b,c:d}}]}}

That is assuming you have created the headers exchange named
my-headers-exchange already, e.g. with qpid-config. This will match any
message with both a header keyed 'a' with value 'b' and a header keyed 'c'
with value 'd'.

Unfortunately it would appear there is a bug in the JMS client preventing
this from working there. (https://issues.apache.org/jira/browse/QPID-3265)

An alternative address would be:

  my-subscription-queue; {create:always, node:{x-declare:{auto-delete:True},
x-bindings:[{queue:my-subscription-queue, exchange:my-headers-exchange,
arguments:{'x-match':all,a:b,c:d}}]}}

However that requires that my-subscription-queue be a unique name - not sure
how well that will work for a JNDI based destination.

I verified that the above addressing string can be specified in the
JNDI properties.

The point is not that it can't be specified in JNDI but that multiple consumers created from the destination obtained will all be using the same queue and will thus compete for messages which is not what you want.

If there was only going to be one consumer that might not be an issue of course.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscr...@qpid.apache.org

Reply via email to