RabbitMQ

from Wikipedia, the free encyclopedia
RabbitMQ

RabbitMQ logo
Basic data

developer Pivotal software
Current  version 3.8.6
( August 4, 2020 )
operating system Platform independence
programming language Erlang
category Advanced Message Queuing Protocol Message Oriented Middleware
License Mozilla Public License
www.rabbitmq.com

RabbitMQ is an open source message broker software that implements the Advanced Message Queuing Protocol (AMQP). The RabbitMQ server is written in Erlang . The software is developed and maintained by Rabbit Technologies Ltd , a merger of LShift and Cohesive FT , which SpringSource acquired in April 2010 . SpringSource was a division of VMware that was spun off in April 2013 into a newly formed joint venture between VMware, EMC Corporation and General Electric called Pivotal Software Inc.

Examples

This section shows program examples in Python :

Send

The following program establishes a connection, ensures the existence of the recipient queue, sends the message and closes the connection:

#!/usr/bin/env python
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='hello')
channel.basic_publish(exchange='',routing_key='hello', body='Hello World!')
print " [x] Sent 'Hello World!'"
connection.close()

Receive

Accordingly, the following program receives messages from the queue and displays their contents on the screen:

#!/usr/bin/env python
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
channel = connection.channel()
channel.queue_declare(queue='hello')
print ' [*] Waiting for messages. To exit press CTRL+C'
def callback(ch, method, properties, body):
    print " [x] Received %r" % (body,)
channel.basic_consume(callback,queue='hello',no_ack=True)
channel.start_consuming()

See also

Web links

Individual evidence