You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Jason Barto <ja...@gmail.com> on 2013/03/15 02:22:48 UTC

Using QPID AMQP via SwiftMQ Java API

I'm new to AMQP 1.0, coming from RabbitMQ/9-1 and I am trying to get my
head wrapped around the changes.  I'm creating an AMQP test client using
SwiftMQ's Java API.

I have a producer sending messages to a topic with a specific subject (I
understand these are aligned with the old routing keys?).

Where I'm confused is how to create a consumer for messages sent to the
topic with a specific subject.  The SwiftMQ API doesn't permit for
specification of anything other than a source with an optional 'message
selector' (I think that's a JMS term?).  Do I need to specify a message
selector in order to get my consumer bound to a topic with a particular
routing key?  Or is this done through the source address?

Thanks in advance for any enlightenment,
Jason

Re: Using QPID AMQP via SwiftMQ Java API

Posted by Rob Godfrey <ro...@gmail.com>.
On 15 March 2013 14:04, Gordon Sim <gs...@redhat.com> wrote:
> On 03/15/2013 01:22 AM, Jason Barto wrote:
>>
>> I'm new to AMQP 1.0, coming from RabbitMQ/9-1 and I am trying to get my
>> head wrapped around the changes.  I'm creating an AMQP test client using
>> SwiftMQ's Java API.
>
>
> Which broker are you working with? (The java broker or the c++ broker?)
>
>
>> I have a producer sending messages to a topic with a specific subject (I
>> understand these are aligned with the old routing keys?).
>
>
> Correct.
>
>
>> Where I'm confused is how to create a consumer for messages sent to the
>> topic with a specific subject.  The SwiftMQ API doesn't permit for
>> specification of anything other than a source with an optional 'message
>> selector' (I think that's a JMS term?).  Do I need to specify a message
>> selector in order to get my consumer bound to a topic with a particular
>> routing key?  Or is this done through the source address?
>
>
> A JMS selector filter will not currently work as expected with the c++
> broker. Support for selectors is being added but it does not yet cover the
> case where a consuming link is established to a topic exchange. There is
> support for a subject filter
> (https://svn.apache.org/repos/asf/qpid/trunk/qpid/specs/apache-filters.xml#type-legacy-amqp-topic-binding)
> but that is a registered extension to the core protocol (as is the selector
> filter) and is likely not supported by the SwiftMQ client. Andreas could
> probably clarify that.
>
> I'm not sure of the situation with the java broker. Rob, will a selector on
> its own work as expected when creating a link from a topic exchange? Or
> perhaps using a fanout exchange since the selection is done entirely by the
> selector?

Apologies for the delay in responding.  So, if I read the code
correctly, creating a receiving link from a topic exchange with a
filter of type "apache.org:legacy-amqp-topic-binding:string" will,
behind the scenes, create a temporary queue and bind that to the topic
exchange with the filter value as the binding key.  An additional JMS
filter will only be applied on the consumer from the queue (thus will
lead to non selected messages being orphaned on the temporary queue
unless they timeout or are otherwise archived).

-- Rob

>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Using QPID AMQP via SwiftMQ Java API

Posted by Gordon Sim <gs...@redhat.com>.
On 03/15/2013 01:22 AM, Jason Barto wrote:
> I'm new to AMQP 1.0, coming from RabbitMQ/9-1 and I am trying to get my
> head wrapped around the changes.  I'm creating an AMQP test client using
> SwiftMQ's Java API.

Which broker are you working with? (The java broker or the c++ broker?)

> I have a producer sending messages to a topic with a specific subject (I
> understand these are aligned with the old routing keys?).

Correct.

> Where I'm confused is how to create a consumer for messages sent to the
> topic with a specific subject.  The SwiftMQ API doesn't permit for
> specification of anything other than a source with an optional 'message
> selector' (I think that's a JMS term?).  Do I need to specify a message
> selector in order to get my consumer bound to a topic with a particular
> routing key?  Or is this done through the source address?

A JMS selector filter will not currently work as expected with the c++ 
broker. Support for selectors is being added but it does not yet cover 
the case where a consuming link is established to a topic exchange. 
There is support for a subject filter 
(https://svn.apache.org/repos/asf/qpid/trunk/qpid/specs/apache-filters.xml#type-legacy-amqp-topic-binding) 
but that is a registered extension to the core protocol (as is the 
selector filter) and is likely not supported by the SwiftMQ client. 
Andreas could probably clarify that.

I'm not sure of the situation with the java broker. Rob, will a selector 
on its own work as expected when creating a link from a topic exchange? 
Or perhaps using a fanout exchange since the selection is done entirely 
by the selector?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org