How to Install RabbitMQ on Windows Server 2016/2019/2022 (Tutorial)

How to Install RabbitMQ on Windows Server 2016/2019/2022. In recent times top companies prefer to install a software that works as a messenger without additional charge. There is one particular tool that offers unlimited message sending services within the organizations, popularly known as “RabbitMQ“.

What is RabbitMQ?

RabbitMQ is a widely used open source message broker software application. The RabbitMQ software is built on the advanced message queuing protocol and extended by using plug in architecture to support streaming text oriented messenger services throughout the business organizations. It provides a common platform to send and receive a message and also facilitates encryption services to maintain confidentiality. RabbitMQ is mainly used by large companies within the industries, an example for the companies which have already adopted RabbitMQ applications are Zalando, Boomerang, WeWork, WunderList, and many more.

The RabbitMQ is written using the Erlang programming language, the RabbitMQ server is built based on the “Open telecom platform framework” for clustering message requests from the client. The RabbitMQ executable source codes are released under “Mozilla Public license”.

How does RabbitMQ Work?

in the Article How to Install RabbitMQ on Windows Server 2016/2019/2022 let’s explain how the RabbitMQ software sends and receives messages within the organizations. Here is an image that illustrates the overview of the RabbitMQ:

RabbitMQ workflow

The important factors that will explain the overall workflow of the RabbitMQ:

  • In the above figure, RabbitMQ acts as a middleware for various services like Web Applications, API Applications, etc. They can also be used to reduce the data load and delivery times of the web applications while taking up the resources from third parties.
  • In this example, we have taken an example of a web application that allows users to upload information to the websites. Later on, a piece of uploaded information will be generated in the form of a PDF and emailed back to the users. This kind of task required a lot of time while exchanging the information and generating them in PDF formats, so to overcome this issue, a message queue will be used.
  • The basic architecture of the RabbitMQ is very simple, the client side application is called a “producer” that creates messages, then delivers these messages into the “broker”. The server side application is known as a “consumer” that connects to the queue and is subscribed to get proceeds.
  • All the messages are placed onto a “queue” that is stored until the consumer retrieves them to perform further tasks.
  • Most of the time, when you consider sending messages, that will be going to exchange, and exchange pushes all these messages to multiple queues. This enables users to get a message from queues where it gets bonded.
  • Instead of publishing all the received messages directly into the queue, producers will come up to exchange messages.
  • An exchange messenger accepts the PDF format messages from the producers and routes them into the PDF creations or performs corrections.
  • Now the exchange delivers messages to the message queues with the help of exchange types.
  • There are three types of message exchanges available: Direct, Fanout, and topic.
  • The fanout message type just broadcasts all the messages it received to the known queues. And most of the time it ignores the binding values since it has to forward all the messages to queues that are shown in the below diagram:
  • In a direct message, a message goes directly to the queue whose binding key matches with the routing key of the message. In the fanout the binding value will be null since the exchange delivers messages to all the queues as shown below:
  • In this example, if the message published to exchange is with the routing key (that can be indicated in “orange” color), it will be first delivered only to the first Q1 (like FIRST IN FIRST OUT) whose binding key matches the routing key (indicated in blue color).
  • Topic message type works the same as direct message but the difference is that “routing key can be used based on multiple criteria”.
    Consider the below example:

Where

  • * indicates exactly one word,
  • # indicates zero or more words.

In the next section of how to install the RabbitMQ server on Windows server 2016/2019/2022, we will explain about how to install Erlang on Windows. 

Install Erlang on Windows Server

RabbitMQ runs on Erlang Virtual Machine. So you will need to install the Erlang package before installing RabbitMQ. Follow the below steps to install the Erlang on Windows:

Step 1 – Go to the Erlang download page and download it to your Windows system.

Step 2 – Once the download is completed, double click on the downloaded installer to start the installation. You should see the Erlang component selection page:

Step 3 – Click on the Next button. You should see the Erlang installation location selection page:

Step 4 – Choose your location and click on the Next button. You should see the start menu selection page:

Step 5 – Select your start menu folder and click on the Install button. You should see the Microsoft license term page:

Step 6 – Accept the license term and click on the Install button. Once all the Microsoft components are installed, you should see the following page:

Step 7 – Click on the Close button to start the Erlang installation. Once the Erlang is installed, you should see the following page:

Step 8 – Click on the Close button to finish the installation.

Install RabbitMQ on Windows Server 2016, 2019, 2022

After installing the required components onto your system, please follow the below steps to install the RabbitMQ on Windows:

Step 1 – Go to the RabbitMQ download page and download it to your system.

Step 2 – Once the download is completed, double click on the installer to start the installation. You should see the component selection page:

Step 3 – Click on the Next button. You should see the installation location selection page:

Step 4 – Click on the Install button to start the installation. Once the RabbitMQ is installed, you should see the following page:

Step 5 – Click on the Next button. You should see the following page:

Step 6 – Click on the Finish button to close the installation wizard.

Now, open the RabbitMQ command line interface and verify the status of the RabbitMQ server using the following command:

				
					rabbitmqctl status
				
			

You will get the following output:

				
					Status of node rabbit@CLOUD-OKTCGM1OC ...
[1mRuntime[0m

OS PID: 2460
OS: Windows
Uptime (seconds): 208
Is under maintenance?: false
RabbitMQ version: 3.9.13
Node name: rabbit@CLOUD-OKTCGM1OC
Erlang configuration: Erlang/OTP 24 [erts-12.2.1]  [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit]
Erlang processes: 292 used, 1048576 limit
Scheduler run queue: 1
Cluster heartbeat timeout (net_ticktime): 60

[1mPlugins[0m

Enabled plugin file: c:/Users/Administrator/AppData/Roaming/RabbitMQ/enabled_plugins
Enabled plugins:


[1mData directory[0m

Node data directory: c:/Users/Administrator/AppData/Roaming/RabbitMQ/db/rabbit@CLOUD-OKTCGM1OC-mnesia
Raft data directory: c:/Users/Administrator/AppData/Roaming/RabbitMQ/db/rabbit@CLOUD-OKTCGM1OC-mnesia/quorum/rabbit@CLOUD-OKTCGM1OC

[1mConfig files[0m

* c:/Users/Administrator/AppData/Roaming/RabbitMQ/advanced.config

[1mLog file(s)[0m

* <stdout>
* c:/Users/Administrator/AppData/Roaming/RabbitMQ/log/rabbit@CLOUD-OKTCGM1OC.log
* c:/Users/Administrator/AppData/Roaming/RabbitMQ/log/rabbit@CLOUD-OKTCGM1OC_upgrade.log

[1mAlarms[0m

(none)

[1mMemory[0m

Total memory used: 0.0516 gb
Calculation strategy: rss
Memory high watermark setting: 0.4 of available memory, computed to: 1.7178 gb

code: 0.0331 gb (46.7 %)
other_proc: 0.0203 gb (28.58 %)
other_system: 0.0125 gb (17.57 %)
other_ets: 0.0032 gb (4.52 %)
atom: 0.0013 gb (1.89 %)
metrics: 2.0e-4 gb (0.31 %)
binary: 1.0e-4 gb (0.14 %)
mnesia: 1.0e-4 gb (0.13 %)
plugins: 0.0 gb (0.06 %)
msg_index: 0.0 gb (0.05 %)
quorum_ets: 0.0 gb (0.05 %)
stream_queue_procs: 0.0 gb (0.0 %)
stream_queue_replica_reader_procs: 0.0 gb (0.0 %)
allocated_unused: 0.0 gb (0.0 %)
connection_channels: 0.0 gb (0.0 %)
connection_other: 0.0 gb (0.0 %)
connection_readers: 0.0 gb (0.0 %)
connection_writers: 0.0 gb (0.0 %)
mgmt_db: 0.0 gb (0.0 %)
queue_procs: 0.0 gb (0.0 %)
queue_slave_procs: 0.0 gb (0.0 %)
quorum_queue_procs: 0.0 gb (0.0 %)
reserved_unallocated: 0.0 gb (0.0 %)
stream_queue_coordinator_procs: 0.0 gb (0.0 %)

				
			

RabbitMQ Web Interface

RabbitMQ provides a web based interface to manage and monitor the server. But, it is disabled by default. You can enable it by running the following command:

				
					rabbitmq-plugins enable rabbitmq_management
				
			

You will get the following output:

				
					Enabling plugins on node rabbit@CLOUD-OKTCGM1OC:
rabbitmq_management
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@CLOUD-OKTCGM1OC...
The following plugins have been enabled:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch

started 3 plugins.

				
			

Create RabbitMQ Admin User

Next, you will need to create an administrator user to access the RabbitMQ admin interface. You can add the user using the following command:

				
					rabbitmqctl add_user admin yourpassword
				
			

Next, tag the user as administrator user using the following command:

				
					rabbitmqctl set_user_tags admin administrator
				
			

Next, grant required permission to admin user with the following command:

				
					rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
				
			

You can now list all users using the following command:

				
					rabbitmqctl list_users
				
			

You will get all users in the following output:

				
					Listing users ...
user tags
admin [administrator]
guest [administrator]

				
			

Next, it is recommended to delete the guest user account. You can delete it using the following command:

				
					rabbitmqctl delete_user guest
				
			

Access RabbitMQ Admin Interface

Now, open your web browser and access the RabbitMQ admin interface using the URL http://localhost:15672/. You should see the RabbitMQ login page:

Provide your admin username, password and click on the Login button. You should see the RabbitMQ dashboard on the following page:

rabbitmq dashboard

How to Install RabbitMQ on Windows Server 2016/2019/2022 Conclusion

Congratulations! you have successfully installed the RabbitMQ server on Windows server 2016/2019/2022. I hope you have now enough knowledge to deploy the RabbitMQ server on the production environment.

Avatar for Hitesh Jethva
Hitesh Jethva

I am a fan of open source technology and have more than 10 years of experience working with Linux and Open Source technologies. I am one of the Linux technical writers for Cloud Infrastructure Services.

5 1 vote
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x