RabbitMQ
RabbitMQ is an open-source message-broker software that originally implemented the Advanced Message Queuing Protocol and has since been extended with a plug-in architecture to support Streaming Text Oriented Messaging Protocol, MQ Telemetry Transport, and other protocols.
Written in Erlang, the RabbitMQ server is built on the Open Telecom Platform framework for clustering and failover. Client libraries to interface with the broker are available for all major programming languages. The source code is released under the Mozilla Public License.
Since November 2020, there are commercial offerings available of RabbitMQ, for support and enterprise features: "VMware RabbitMQ OVA", "VMware RabbitMQ" and "VMware RabbitMQ for Kubernetes" Open-Source RabbitMQ is also packaged by Bitnami and commercially for VMware's Tanzu Application Service.
History
Originally developed by Rabbit Technologies Ltd. which started as a joint venture between LShift and CohesiveFT in 2007, RabbitMQ was acquired in April 2010 by SpringSource, a division of VMware. The project became part of Pivotal Software in May 2013, which then got acquired back by VMware in December 2019.The project consists of:
- The RabbitMQ exchange server
- Gateways for AMQP, HTTP, STOMP, and MQTT protocols
- AMQP client libraries for Java, .NET Framework and Erlang.
- A plug-in platform for extensibility, with a predefined collection of supported plug-ins, including:
- *A "Shovel" plug-in that takes care of moving or copying messages from one broker to another.
- *A "Federation" plug-in that enables efficient sharing of messages between brokers.
- *A "Management" plug-in that enables monitoring and control of brokers and clusters of brokers.
Examples
This section gives sample programs written in Python for sending and receiving messages using a queue.Sending
The following code fragment establishes a connection, makes sure the recipient queue exists, then sends a message and finally closes the connection.- !/usr/bin/env python3
connection = pika.BlockingConnection
channel = connection.channel
channel.queue_declare
channel.basic_publish
connection.close
Receiving
Similarly, the following program receives messages from the queue and prints them on the screen:- !/usr/bin/env python3
def callback:
connection = pika.BlockingConnection
channel = connection.channel
channel.queue_declare
channel.basic_consume
channel.start_consuming