What is RabbitMQ ? How to Install?

Experienced Full Stack Java developer. Have Strong Experience in JSP/Servlet, JSF, Jasper Report, Spring Framework, hibernate, Angular 5+, Microservices. Experienced in Front-end technologies such as HTML, CSS, JavaScript, angular 6+, AJAX, JSON, and XML. Strong Hands-on experience on working with Reactive Forms to build form-based application in Angular 6+.
RabbitMQ is an open source Message broker software that facilitates asynchronous communications between components of distributed systems.
It implements Advanced message Queuing protocol AMQP.

Basically exchange and queue routes message from producer to consumer.
Exchange -> Routes the message to appropriate Queue
Queue -> Routes to appropriate Application(consumer)

Why do we need RabbitMQ ?
Lets assume we have an e-commerce website which sells shoes.
Now, Once the costumer places an Order we have to do multiple task such as payments, order confirmation message/mail sending, sending delivery notifications.
all these task doesn't have to be done one by one, we can do it asynchronously like sending message and payment and sending notifications can be done randomly and parallelly to make things faster.
But how to do it asynchronously ? well we can write a very complex thread related code which can do this. But is it worth it? we all know how complicated it can be while managing threads or thread pool from my thread related blogs .
That's why we need messaging Queue like RabbitMQ who can handle this for us and we can be saved from all those complicated codes.
How to install RabbitMQ in windows 10 ?
Go to https://www.rabbitmq.com/install-windows.html and download the rabbitmq-server-3.12.12.exe.
Go to https://www.erlang.org/patches/otp-25.3.2 and download Erlang for windows.
Then first install Erlang and set environment variables as below.

Then install RabbitMQ using the exe file.
Once installed go to "C:\Program Files\RabbitMQ Server\rabbitmq_server-3.12.12\sbin" and run the command "rabbitmq-plugins.bat enable rabbitmq_management" using command prompt. It will enable some plugins.
Once done you can start and stop the RabbitMQ using below shortcuts

Then you can access RabbitMQ UI with the URL "http://127.0.0.1:15672/" or "http://localhost:15672/"
initial Credential is "guest/guest"

Now that you have installed RabbitMQ, in the next blog we will continue to learn more about RabbitMQ.




