RabbitMQ is open source message broker software (sometimes called message-oriented middleware) that implements the Advanced Message Queuing Protocol (AMQP). The RabbitMQ server is written in the Erlang programming language and is built on the Open Telecom Platform framework for clustering and failover. The RabbitMQ can run on a variety of platforms, If we are planning on doing any distributed, asynchronous processing and we need a system to queue and process items in the background, then we should seriously consider RabbitMQ.
The online documentation is great and there are plenty of tutorials that can take us through the basics of creating and consuming queues in your application. However, before we start typing any code, we first need to get RabbitMQ up and running somewhere (local system, server etc). In this post, we will download, install and start RabbitMQ instance and see what’s needed to get us to that point.
Since RabbitMQ is built on top of Erlang, So it runs on the Erlang virtual runtime, we will first need to install Erlang without it we can’t get RabbitMQ to work. Got to the Erlang downloads page and download the erlang binary file for windows which is an executable. We will choose the 32 or 64bit version depending on the system we plan to install it.
Next, run the binary file downloaded and install erlang on the machine, There is no restart required, so this first step is easy. Before we continue, ensure that the appropriate environment variable (ERLANG_HOME) has been created during the installation. If for any reason, the environment variable is missing, We will need to create it manually as per the image below:
RABBITMQ SERVICE INSTALLATION
Go to RabbitMQ downloads page and download RabbitMQ installation.
This will be a .exe installation file for windows. Run this exe and install RabbitMQ on your machine. RabbitMQ runs, by default, as a Windows Service and technically we shouldn’t need to do anything else to start interacting with it. However, any interaction with the service needs to happen over the command-line. The above installation should have installed the RabbitMQ command prompt. To Open it Go to the RabbitMQ Server Location and use the command as follows to check RabbitMQ is running, If RabbitMQ already running we get the below message:
Next, we will install the RabbitMQ plugin which will give us the RabbitMQ Management Console which is accessible using the browser. For this use the command as follows:
rabbitmq-plugins.bat enable rabbitmq_management
To check if everything worked as expected, Go to http://localhost:15672/ We will see the RabbitMQ console prompted for username and password. The default credentials are:
Bingo !! WOW, we will be presented with the following page:
- Username: guest
- Password: guest