You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Tom Arnold <ta...@gmail.com> on 2011/07/07 17:40:21 UTC

RabbitMQ JMS Client

Hi all,

I'm interested in talking to a RabbitMQ broker through a JMS client.

It looks like Rabbit's interop page (
http://www.rabbitmq.com/interoperability.html) is a bit out of date (Rabbit
2.0.0). I've tried using Qpid's JMS client without much success (it doesn't
seem to want to negotiate protocol version), and OpenAMQ's JMS client seems
to have disappeared.

Does anyone have Qpid (or any other JMS client) working with Rabbit?

Thanks!
-Tom

Re: RabbitMQ JMS Client

Posted by Gordon Sim <gs...@redhat.com>.
On 07/08/2011 02:01 PM, Gordon Sim wrote:
> If I use the first two types of configuration mentioned in the example
> at https://cwiki.apache.org/qpid/how-to-use-jndi.html (i.e. queue.xyz =
> or topic.xyz = ) then the 0-9-1 path incorrectly issues
> exchange-declares without the passive flag set (for amq.direct or
> amq.topic respectively).

Ok, with the following patch applied I can get past this particular 
issue. If can then send a message and receive it through a MessageListener.

The 'pull' style receive() call doesn't appear to work. It does 
correctly result in a channel.flow, but the broker doesn't seem to 
respond by sending any message.

I'm still interested in getting ideas on how to get the destination 
style jndi properties working with BURL.

Re: RabbitMQ JMS Client

Posted by Gordon Sim <gs...@redhat.com>.
On 07/08/2011 02:01 PM, Gordon Sim wrote:
> If I use the first two types of configuration mentioned in the example
> at https://cwiki.apache.org/qpid/how-to-use-jndi.html (i.e. queue.xyz =
> or topic.xyz = ) then the 0-9-1 path incorrectly issues
> exchange-declares without the passive flag set (for amq.direct or
> amq.topic respectively).

Further update: it was suggested that I try setting the 
qpid.declare_exchanges system property to false. That doesn't work 
either. Looking at the code it appears that property only affects 
consumers (and publishers on AMQP 0-10).

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


Re: RabbitMQ JMS Client

Posted by Gordon Sim <gs...@redhat.com>.
On 07/07/2011 04:40 PM, Tom Arnold wrote:
> Hi all,
>
> I'm interested in talking to a RabbitMQ broker through a JMS client.
>
> It looks like Rabbit's interop page (
> http://www.rabbitmq.com/interoperability.html) is a bit out of date (Rabbit
> 2.0.0). I've tried using Qpid's JMS client without much success (it doesn't
> seem to want to negotiate protocol version), and OpenAMQ's JMS client seems
> to have disappeared.
>
> Does anyone have Qpid (or any other JMS client) working with Rabbit?

I had a go at this... but without real success. The first thing is to 
make sure you have the virtual host correctly set. I set it to '/' and 
with guest/guest managed to connect.

However I have as yet been unable to send messages. To connect to 
RabbitMQ the client has to use AMQP 0-9-1 and my initial attempts to 
sent to a queue or topic defined in jndi properties met with the 
following error:

java.lang.UnsupportedOperationException: The new addressing based sytanx 
is not supported for AMQP 0-8/0-9 versions

If I use the first two types of configuration mentioned in the example 
at https://cwiki.apache.org/qpid/how-to-use-jndi.html (i.e. queue.xyz = 
or topic.xyz = ) then the 0-9-1 path incorrectly issues 
exchange-declares without the passive flag set (for amq.direct or 
amq.topic respectively).

I have as yet been unable to use the third form (which I believe should 
in theory allow me to use another exchange and workaround the above 
bug). If I specify -Dqpid.dest_syntax=BURL then I get an error looking 
up my JNDI name. If I don't have that system property I get the above 
error on incorrect 'sytanx'.

If I then try using 
Session.createTopic("BURL:topic://amq.topic?routingkey='stocks.nyse.ibm'") 
('url' taken from https://cwiki.apache.org/qpid/bindingurlformat.html)

I get: java.net.URISyntaxException: Error occured while parsing URL at 
index 47: topic://amq.topic?routingkey='stocks.nyse.ibm'%^
Caused by: java.lang.ArrayIndexOutOfBoundsException: 47
	at 
org.apache.qpid.url.BindingURLParser.extractExchangeName(BindingURLParser.java:227)

I get the same if I remove the 'BURL:' and go back to 
-Dqpid.dest_syntax=BURL.  Likewise the same type of error occurs if I 
change the binding url to another example 
(direct://amq.direct/SimpleQueue) and use createQueue() instead of 
createTopic().

At this point I am out of ideas; can anyone suggest a way of getting 
something working here? Is there a JIRA open for the non-passive declare 
problem?



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