RabbitMQ Tutorial

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/rabbitmq-tutorial/
PINTEREST
PINTEREST
INSTAGRAM

RABBITMQ is a message broker which works as a common channel for different entities. The main purpose of RABBITMQ is clustering and high availability. Message producer entities put message to the RABBITMQ and then the consumers get it according to work plan. If some of the producers or consumers fail the remainings still works. Advenced Messaging Queuing Protocol (AMQP) is the main standart that is implemented  by RABBITMQ.

RABBITMQ gives reliability to the application with acknowledgements and publisher confirms. Messages can be bind to the different entities according to the given logic. Several RABBITMQ servers can be clustered which makes high availability. RABBITMQ can federate several different applications and makes it easy. Here can be given more examples but theses are enough.

Installation ofRabbitMQ

Install RABBITMQ to the fedora

Install Python Library For RabbitMQ

In this tutorial we will use python language. But we need a library which supports AMQP. We choose to use pika so we install it with the following command

We need to firstly check the status of the rabbitmq server. Here we get that it is not started and we start it with default configuration

Start RabbitMQ Server Daemon

Create Producer

We will write some producer to create messages to ht RabbitMQ server. We put following code into p1.py 

LEARN MORE  Pgrep and Pkill Command Tutorial With Examples For Linux

Now run the producer and send the message to the queue.

Create Consumer

Here is the consumer which waits after running for a message. File name of the consumer is c1.py 

Start Consuming Producers Messages

If we run producer we get the message

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/rabbitmq-tutorial/
PINTEREST
PINTEREST
INSTAGRAM

Leave a Reply

Your email address will not be published.