Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A Web chat implemented with RabbitMQ and Websockets
JavaScript Erlang Shell
tree: 747906c451

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

RabbitMQ Chat

This project shows how to create a simple web chat room with RabbitMQ.

The chat server uses Websockets to send messages to the connected users. This means it only works with Chrome and Safari. Some browsers like Firefox 4 can be configured to enable Websockets.

On the RabbitMQ side there it uses a custom exchange to store the last 20 messages, so new users connecting to the chat room can get a context of what's going on. See the project Recent History Exchange for installation instructions.


The Recent History Exchange has to be installed prior to running this application.

How does it work

Each user that connects to the server will get a private auto delete anonymous queue. This queue will be managed by an AMQP consumer. Whenever the AMQP consumer recieves a message it will forward it to the Websockets process and this one will send it to the user browser.

When the user is disconnects from the server his consumer gets closed and the queue deleted.


Get the source code:

$ git clone git://
$ cd rabbitmq-chat

Compile the source code:

$ make


  • Install the Recent History Exchange plugin if you haven't done so.

  • Start RabbitMQ if is not running already.

  • Start the server:

    $ ./

Point your browser to http://localhost:8080/. Invite your friends. Enjoy!


Inspired by YakRiak

Original design adapted from YakRiak. Thanks Basho and the crew, specially @pharkmillups for being an awesome community manager.



Something went wrong with that request. Please try again.