RabbitMQ XMPP gateway released

This page is a mirrored copy of an article originally posted on the LShift blog; see the archive index here.

I’m pleased to announce that our XMPP gateway for exposing a RabbitMQ instance to the global XMPP network has been released (documentation, browse or check out code, download snapshot).

Update: Because it depends on a newer release of RabbitMQ than 1.3.0, you will also need to check out the server and codegen code from our public mercurial repositories, or download them as snapshots: server, codegen.

Gateway in relation to ejabberd and RabbitMQ

The mod_rabbitmq module implements an ejabberd extension module which gateways AMQP (as implemented by RabbitMQ) to XMPP.

By bridging between the two systems, we benefit from:

  • XMPP’s internet-scale addressing and federation
  • XMPP’s presence model
  • AMQP’s store-and-forward capability
  • AMQP’s routing and filtering (using exchanges and bindings)

The current implementation is a very simple mapping between the two systems. Its simplicity keeps the code short, but only exposes a subset of AMQP features to the XMPP network, and vice versa.

Read more here.


On 3 July, 2008 at 5:52 pm, tonyg wrote:

((I accidentally deleted a bunch of comments I didn’t mean to delete today, so I’m having to repost them manually:))

Pedro Melo wrote:


great work!

Now that ejabberd supports (version 2.x and up) pluggable back.-end’s to their pubsub stuff, are there any plans to make mod_rabbitmq such a module?

this would allow us to use XEP-0060 (PubSub over XMPP) with RabbitMQ topics.


On 3 July, 2008 at 5:52 pm, tonyg wrote:

((I accidentally deleted a bunch of comments I didn’t mean to delete today, so I’m having to repost them manually:))

Mickaël Rémond wrote:


This sounds like a good idea.
If you want to, we would be happy to give you an access to ejabberd-modules svn for your ejabberd module gateway code.

We try to gather as much as possible of the modules developed for ejabberd in this space.


Let me know

Mickaël Rémond

On 3 July, 2008 at 5:55 pm, tonyg wrote:

@Pedro: That’s an interesting idea. I haven’t yet had a look to see how difficult it might be, but if pubsub and AMQP can be fit together reasonably smoothly, it would definitely be a good idea to do so.

@Mickael: Thanks very much. It’s still pretty experimental, and will probably evolve fairly rapidly. Once it settles down a little, we’d be happy to contribute it to the ejabberd community.

On 7 August, 2008 at 7:54 pm, Bryan wrote:

The repository seems to be down.

On 7 August, 2008 at 10:37 pm, tonyg wrote:

Thanks for the heads-up, Bryan — we’re looking into the problem.

On 8 August, 2008 at 10:35 am, Paul Crowley wrote:

Oops, I broke that while working on something else. Sorry! Fixed now. Bryan - thanks for letting us know.

On 18 January, 2009 at 9:54 pm, Glenn Rempe wrote:

Hi. I am having trouble compiling the RabbitMQ XMPP gateway into ejabberd. I am working from the Mercurial trunk for the gateway code (27:944d554c2827), and the ejabberd trunk (r1823) and RabbitMQ trunk (772:75288d1eae96). Erlang is R12B5 on Ubuntu Intrepid.

Here are the errors I am seeing after I linked the gateway code into the ejabberd src dir and try to re-compile ejabberd:

And here is the full output as well as the tiny script I am using to help me compile:


Can anyone offer any insights? I am not well versed in Erlang so diagnosing the issue is tough for me.


On 19 January, 2009 at 11:39 pm, tonyg wrote:

Hi Glenn — thanks for posting. The mailing-list thread starting here http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2009-January/003030.html discusses the current problems we’re having getting the XMPP gateway to work. In brief, there’s a mnesia table name clash between RabbitMQ and ejabberd, and we will need to add a unique prefix (e.g. “rabbitmq_”) to all our table names.

On 19 January, 2009 at 11:40 pm, tonyg wrote:

Just to clarify, the XMPP gateway is known to work with RabbitMQ 1.4.x; it will not work with 1.5.x (because of the mnesia table name clash); and it will most likely be fixed again sometime before the release of 1.6.0.

On 31 March, 2010 at 6:24 am, jiannis wrote:

Hi tonyg, does the gateway work with the current RabbitMQ 1.7.x?

On 31 March, 2010 at 2:48 pm, tonyg wrote:

@jiannis: It should! However, since it’s not an official Rabbit release, you are probably better off taking the “default” branches of both rabbitmq and the xmpp gateway from mercurial, and building them yourself.

On 31 March, 2010 at 2:48 pm, tonyg wrote:

To clarify, the problem I mentioned above that affected RabbitMQ 1.5.x with the XMPP gateway has been fixed long ago.

On 5 April, 2010 at 5:32 pm, jiannis wrote:

Hi Tony and thanks for the quick response!

Using RabbitMQ server 1.7.2 after having compiled the gateway code (73c129561101) against ejabberd 2.1.3 and configured as described in the overview document with everything running in localhost. When starting ejabberd though and increasing the log level to debug, modrabbitmq throws an exception in function “exception exit: {{badmatch,{contactingrabbitmq,rabbit@mixer,pang}} in genserver:initit/6″ - rabbit@mixer is the local host.

Can you offer any insights? Is it a configuration issue or I should be looking elsewhere? I am not familiar with Erlang so tracking down the issue by going through the code is a bit difficult for me. Any pointers on where to look? Looking forward to getting this baby going.. :)

On 5 April, 2010 at 9:07 pm, tonyg wrote:

It’s probably an erlang clustering problem. Try either making your ejabberd VM “ejabberd@mixer”, or making your rabbit VM “rabbit@localhost”.

On 10 April, 2010 at 1:04 pm, jiannis wrote:

Great, thanks tony!

It was indeed a configuration issue having to do with the way Mac OS X resolves local hosts - rabbit@machine.local instead of rabbit@machine!

For anyone trying the same you might want to check out the “-name” and “-sname” arguments of the erlang process that starts the ejabberd and RabbitMQ servers as well as Apple support article HT2385 and make sure that the erlang cookies are the same.

What actually helped in tracking this down was first getting two erl shells to ping each other!

Thanks again, lots of love for this product, works great!

On 8 June, 2011 at 5:38 pm, seanh wrote:

Where can I find a copy of mod_rabbitmq? I can’t seem to find it anywhere, the rabbitmq-xmpp repo seems to have disappeared, all the links to it from above don’t work anymore.