Installing RabbitMQ in Windows

0Shares


RabbitMQ
is a message broker which can be used in asynchronous communication between multiple systems and guarantees message delivery and reliability with some exceptions. It is built using a programming language called Erlang. It implements Advanced Message Queueing Protocol (AMQP) for communication.

RabbitMQ software can be downloaded from the RabbitMQ website https://www.rabbitmq.com/download.html. There are many options available as shown in the website page:

Figure 1 – RabbitMQ Home Page

Out of the above-mentioned options, I would be going with the ones that is specified under “Installation Guides”. Since I am interested in Windows OS, I will be hitting the link “With installer (recommended)”.

Figure 2 – Rabbit Installer for Windows

Once I click the link “With installer”, you should see the following page:

Figure 3 – RabbitMQ Installer Download page

Most of the times, we do a wrong step of hitting the rabbitmq-server-3.6.6.exe in the downloads section. But remember, RabbitMQ depends upon the Erlang to run and so we need to install the Erlang first.

Figure 4 – Erlang Windows Binary File

Click on the highlighted link for “Erlang Windows Binary File” and run the exe file and it should install the files at the location C:\Program Files\erlx.x.

Figure 5 – Erlang files

Now after you have installed, check the files are there at the location C:\Program Files\erlx.x and if not, re-run the installer for Erlang.

Once it is done, then go to system environment variables by right-clicking on the PC icon if you are in a folder explorer or through Control Panel à System and Security à System and select the “Advanced system settings” and click on the button “Environment Variables” as shown in the following figure in the “System Properties” popup.

Figure 6  – Environment Variable settings

Click on the button “New” under the second section with caption “System Variables” and add the variable name as “ERLANG_HOME” and set the value as “C:\Program Files\erlx.x” and click “OK” on the respective windows.

Figure 7 – Erlang System variable settings

Now download the RabbitMQ exe files shown at the top of the page and I am here going with the first exe download file from rabbitmq.com. Make sure that the zip file is extracted to C:\Program Files\{Rabbit Folder}

Figure 8 – Installer for Windows System

You should see your files copied into the folder as below:

Figure 9 – RabbitMQ Extracted folder

Now we are ready with RabbitMQ files and the next option is to run the RabbitMQ broker. We can run the RabbitMQ when needed and can be run as a Windows service.

Here I would be going with the second option i.e. Run as a Windows service assuming the server should be available for the publishers and consumers 24/7.

Now run the command prompt as an administrator and go to the folder “sbin” in the RabbitMQ installation folder and from there run the following command:

rabbitmq-service install

Now the RabbitMQ service should be installed and can be confirmed by going to services. Run “services.msc” at the command prompt and it should open the list of Windows services as below and you need to look for the one with name “RabbitMQ”:

Figure 10 – RabbitMQ as a Windows Service

Now, how can we manage the RabbitMQ Broker? The solution is already presented in the zip folder that we downloaded for RabbitMQ and it is called “RabbitMQ Management Console” and we need to enable the plugin for management console.

Run the command prompt as an Administrator and go to folder “sbin” in the C:\Program Files\rabbitmq_server_3.6.6 and execute the following commands:

rabbitmq-plugins enable rabbitmq_management

rabbitmq-service stop

rabbitmq-service remove

rabbitmq-service install

rabbitmq-service start

If all goes well, you should now be able to access the RabbitMQ Management Console by hitting the URL http://localhost:15672 and you should see the following screen with options to enter the credentials. By default, the credentials would be username: guest and password: guest. Enter guest for username and password and now you should be able to view the console page.

Figure 11 – RabbitMQ Login Page

I logged in using my username and password, but you should see the same thing on your screen as below (With tabs “Overview”, “Connections”, “Channels”, “Exchanges”, “Queues”, “Admin”):

Figure 12 – RabbitMQ Management Console

Hope this helps in installing RabbitMQ and the Management Console. Happy RabbitMQ installations!!!

0Shares