RabbitMQ explained

RabbitMQ
Developer:Broadcom
Programming Language:Erlang
Operating System:Cross-platform
Genre:AMQP, message-oriented middleware
License:Mozilla Public License

RabbitMQ is an open-source message-broker software (sometimes called message-oriented middleware) that originally implemented the Advanced Message Queuing Protocol (AMQP) and has since been extended with a plug-in architecture to support Streaming Text Oriented Messaging Protocol (STOMP), MQ Telemetry Transport (MQTT), and other protocols.[1]

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" (different feature levels) [2] Open-Source RabbitMQ is also packaged by Bitnami[3] 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,[4] RabbitMQ was acquired in April 2010 by SpringSource, a division of VMware.[5] The project became part of Pivotal Software in May 2013,[6] which then got acquired back by VMware in December 2019.[7]

The project consists of:

Examples

This section gives sample programs written in Python (using the pika package) 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.

  1. !/usr/bin/env python3

import pika

connection = pika.BlockingConnection(pika.ConnectionParameters(host="localhost"))channel = connection.channelchannel.queue_declare(queue="hello")channel.basic_publish(exchange="", routing_key="hello", body="Hello World!")print(" [x] Sent 'Hello World!'")connection.close

Receiving

Similarly, the following program receives messages from the queue and prints them on the screen:(Note: This example does not acknowledge receipt of the message.)

  1. !/usr/bin/env python3

import pika

def callback(ch, method, properties, body): print(" [x] Received %r" % body)

connection = pika.BlockingConnection(pika.ConnectionParameters(host="localhost"))channel = connection.channelchannel.queue_declare(queue="hello")print(" [*] Waiting for messages. To exit press Ctrl+C")channel.basic_consume(queue="hello", on_message_callback=callback)channel.start_consuming

See also

Further reading

Notes and References

  1. https://www.rabbitmq.com/protocols.html Which protocols does RabbitMQ support?
  2. Web site: VMware RabbitMQ . 5 May 2023.
  3. Web site: RabbitMQ . 2023-05-08 . bitnami.com . en-US.
  4. News: Press release . February 8, 2007 . Launch of RabbitMQ Open Source Enterprise Messaging . October 23, 2013 .
  5. News: Press release . April 13, 2010 . Rabbit Technologies announce acquisition by SpringSource . dead . https://web.archive.org/web/20100418132113/http://www.rabbitmq.com/news.html . April 18, 2010 . October 3, 2013 .
  6. News: Press release . May 14, 2010 . Proudly part of Pivotal . dead . https://web.archive.org/web/20130602054940/http://www.rabbitmq.com/news.html . June 2, 2013 . October 3, 2013 .
  7. Web site: VMware Completes Acquisition of Pivotal . 2023-04-06 . VMware News and Stories . 30 December 2019 . en.