OpenAMQ has released their JMS client for using JMS with AMQP-supporting brokers. This afternoon I experimented with getting it running with RabbitMQ.
After a simple, small patch to the JMS client code, to make it work with the AMQP 0-8 spec that RabbitMQ implements (rather than the 0-9 spec that OpenAMQ implements), the basic examples shipped with the JMS client library seemed to work fine. The devil is no doubt in the details, but no problems leapt out at me.
To get it going, I checked it out using Git (`git clone
git://github.com/pieterh/openamq-jms.git`). Compilation was as simple as running `ant`. Kudos to the OpenAMQ team for making the build process so smooth! (Not to mention writing a great piece of software )
The changes to make it work with AMQP 0-8 were:
– retrieving the 0-8 specification XML
– changing the JMS client library’s `build.xml` file to point to the downloaded file in its `generate.spec` variable
– changing one line of code in `src/org/openamq/client/AMQSession.java`: in 0-8, the final `null` argument to `BasicConsumeBody.createAMQFrame` must be omitted
– re-running the `ant` build
After this, and creating a `/test` virtual-host using RabbitMQ’s `rabbitmqctl` program, the OpenAMQ JMS client examples worked fine, as far as I could tell.
rabbitmqctl add_vhost /test
rabbitmqctl set_permissions -p /test guest ‘.*’ ‘.*’ ‘.*’
You can download the patch file I applied to try it yourself. Note that you’ll need to put the correct location to your downloaded `amqp0-8.xml` file into build.xml.