Using RabbitMQ to message events across nodes
RabbitMQ is a message-oriented middleware that implements Advanced Message Queuing Protocol (AMQP) for extremely robust messaging across a distributed system.
In this recipe, we will use RabbitMQ, which allows you to use multiple servers and broadcast messages across them. One big advantage that RabbitMQ holds in comparison to Memcached (for instance) for this sort of task is that it is actually meant to be used to publish or subscribe style events. This means that we won't have to ping a server to determine whether or not there are changes; RabbitMQ will emit changes as they happen, which makes RabbitMQ a perfect solution for the existing style of Socket.IO.
At the time of writing, there were no satisfactory open source RabbitMQ adapters for Socket.IO. This means that we will need to write our own abstraction.
Getting ready
For this recipe, we will need to install RabbitMQ and have it running locally on our machine. It can be installed from https...