Initially when I search in Internet i found that RabbitMQ is broker. I also could not understand what they meant by that. After some researches only I could understand. RabbitMQ task is getting the messages and forward it to the receiver. I am sure you are familiar with post office system. In post office post man will get the messages from post box and he will give it to post office. In post office we categories the posts according to the regions and deliver it to relevant places through the postman. This is the procedure of RabbitMQ also. RabbitMQ will act as postman, post office and post box. The thing is post office deals with papers and RabbitMQ deals with blobs of data. A program that sends messages is called as "Producer"(P). Queue is the one which stores messages for a sometime. It is with in RabbitMQ. We can say queue is like post box. A queue is not bound by any limits, it can store as many messages as you like ‒ it's essentially an infinite buffer. Like humans put posts into the post box, a producer can send messages to queue. In this case many consumers can try to receive data from one queue. A "Consumer (C)" is a program that mostly waits to receive messages. Note that the producer, consumer, and broker do not have to reside on the same machine; indeed in most applications they don't. We can write producer and consumer in different languages.
Steps to Install RabbitMQ
- You have to check whether RabbitMQ is already in your Ubunthu OS. You can use this code in your terminal.
sudo rabbitmq-server start
If yo u get message like "node with name "rabbit" already running on ", then you can know that in your OS, RabbitMQ is already installed. But you can upgrade new version. To upgrade/newly install, you can use following steps.
- Execute the following command to add the APT repository.
sudo add-apt-repository "deb http://www.rabbitmq.com/debian/ testing main"
- To avoid warnings about unsigned packages, add
key to your trusted key list using below command.
- After the above command, use this command.
sudo apt-key add rabbitmq-signing-key-public.asc
- Run the following command to update the package list.
sudo apt-get update
- Install rabbitmq-server package
sudo apt-get install rabbitmq-server
In this time, if you had RabbitMQ already, then you could upgrade the version of it. If you don't have it already, new version have installed at this time and start the server automatically.
- You can check whether it start/not by following command.
sudo rabbitmqctl status
- In browser you can type like this http://localhost:15672/In this time if you don't get interface like Figure 1, you have to activate plugins (mentioned in step 9).
- Enable plugins.
sudo rabbitmq-plugins enable rabbitmq_management
- You can use "guest" as username and password.
- Yes. I have successfully installed RabbitMQ now. :) In my next blogs, we will focus more on RabbitMQ.