RabbitMQ, Open Source Enterprise Messaging
RabbitMQ is open source solution providing robust messaging for applications. It is easy to use, fit for purpose at cloud scale and supported on all major operating systems and developer platforms.
RabbitMQ can be downloaded and installed from http://www.rabbitmq.com/download.html. It has an interesting tagline “RabbitMQ – Messaging that just works”, and the website says that “you can have RabbitMQ up and running within two minutes of completing your download”. Setting up RabbitMQ is described well in http://www.skaag.net/2010/03/12/rabbitmq-for-beginners/.
RabbitMQ is designed from the ground up to interoperate with other messaging system. It is the leading implementation of AMQP, the open standard for business messaging. It supports XMPP, SMTP, STOMP and HTTP, through adapters, for lightweight web messaging. RabbitMQ is a broker written in Erlang and provides Java and .Net clients.
AMQP is a standard wire-level protocol and semantic framework for high performance enterprise messaging. It is a general system that can be configured for:
- Point-to-point communication – Message producer transmits a message addressed to a particular message consumer. Queues are names and bound to a “direct” exchange to enable this.
- One-to-many broadcasting (including multicast) – The broadcasters publish messages to an AMQP “fanout” exchange (Bind a queue to the exchange and messages sent to that exchange get delivered to all the bound queues).
- Transactional publication and acknowledgement – An AMQP channel is opened, transactional mode is selected, messages are published and acknowledged, and the transaction is committed.
- Reliable persistent message delivery – Messages published in persistent mode are logged to disk for durability
- High-speed transient message flows – By sending message outside the transactional part of the protocol, in non-persistent mode, very high throughput and latency can be achieved.
- Store-and-forward – Implemented by delivering messages marked as “persistent” to AMQP’s durable queues. These messages are stored on disk until a consumer retrieves and deletes them.
- Wide area messaging – By decoupling routing logic from message delivery, RabbitMQ is able to support extended broker clustering across WANs.
- File Streaming – AMQP Protocol now supports file streaming. Very large files are transferred to a temporary area on the broker before being routed to queues for download by consumers.
A RabbitMQ broker is a logical grouping of one or several Erlang nodes (cluster), each running the RabbitMQ application and sharing users, virtual hosts, queues, exchanges, etc. A node can be a RAM node or disk node. RabbitMQ brokers tolerate the failure of individual nodes. Nodes can be started and stopped at will. Creating a cluster with only RAM nodes is not recommended – as in case of failure of the cluster, the entire state of the cluster, including all messages will be lost.
All data/state required for the operation of a RabbitMQ broker is replicated across all nodes, for reliability and scaling, with full ACID properties. Message queues, which currently only reside on the node that created them, are visible and reachable from all nodes. Future releases of RabbitMQ will introduce migration and replication of message queues.
The RabbitMQ-memcached project is a Memcached adapter for the RabbitMQ server allows the use of memcache protocol to get or publish a message from or to RabbitMQ.
RabbitMQ’s support for SASL is limited to PLAIN authentication mechanism. Authorization is implemented using a distributed database table mapping users to virtual hosts. Encryption of message could be implemented within the RabbitMQ client library.
Products like RabbitMQ supporting AMQP standard provide the basis for SQL-NoSQL hybrid solutions (where replication would be the key). Drizzle is an example of this being supported at a product level. Using RabbitMQ as the transport, Drizzle can replicate data as serialized Java objects to Voldemort, as JSON marshalled objects to Memcached or as a hashmap to column family based Cassandra.
RabbitMQ provides a simple and cost saving alternative for high end messaging solutions. VMWare business unit SpringSource has acquired RabbitMQ and provides a full range of Commercial support services to Enterprise customers.