Spring RabbitMQ is the message broker based on Spring AMQP protocol implementation.

Spring RabbitMQ

In my previous post, we have discussed about AMQP Protocol and Spring AMQP Module in detail theoretically. Before reading this post, Please read that post here: Spring AMQP.

In this post, we are going to discuss on two things mainly: “How to install RabbitMQ Server” and “How to setup Queue & Exchanges in RabbitMQ Server”.

In my coming post, we will discuss and develop one Spring AMQP RabbitMQ Messaging application with one simple and useful example.

Spring AMQP Modules

Spring AMQP Projects are located at the following website: https://projects.spring.io/spring-amqp/

Spring Framework has two modules to support Spring AMQP RabbitMQ development.

    • spring-amqp:

It is base abstraction for AMQP Protocol implementation.

    • spring-rabbit:

It is the RabbitMQ implementation.

spring-amqp-robbitmq-1

Install Spring RabbitMQ Server

Please use the followings steps to download and install RabbitMQ Server into local system.

    1. Download Erlang and RabbitMQ Server softwares

We need to install both Erlang and Rabbit MQ server to start our Application Setup.

      1. Download Erlang from https://www.erlang.org/download.html
      2. Download Rabbit MQ from https://www.rabbitmq.com/install-windows.html
    1. Install Erlang Software

First install Erlang by double clicking “otp_win64_R16B03-1.exe” then follow default options by clicking “Next” then finally click on “Install” button.

    1. Install Rabbit MQ Server Software

First install Rabbit MQ Server by double clicking “rabbitmq-server-3.2.3.exe” then follow default options by clicking “Next” then finally click on “Install” button.

Once we install Rabbit MQ Server, we can see it’s HOME folder as shown below:

Set the following SYSTEM variable if missing.

RABBITMQ_HOME=C:Program Files (x86)RabbitMQ Serverrabbitmq_server-3.2.3

    1. Configure Rabbit MQ Server

By default, Rabbit MQ Server comes with no plug-ins that means we cannot use it as a JMS Provider. We need to perform the following steps:

Open CMD Prompt

CMD>CD to ${RABBITMQ_HOME}/sbin

Install Rabbit MQ Plug-ins by using below command

CMD> rabbitmq-plugins.bat enable rabbitmq_management

Restart Rabbit MQ Server from Windows Control Pannel –> Services

Access Rabbit MQ Admin console by using https://localhost:15672/

Click on “Add a new queue” link to create a new queue and provide details

rabbitmq_queue_create

Click on “Add queue” button

Spring AMQP RabbitMQ Server Setup

We need to do the following setup to develop Spring AMQP Messaging application with RabbitMQ Server.

    1. Install Erlang and RabbitMQ Server (Please refer previous section).
    2. Access Rabbit MQ Admin console

Access Rabbit MQ Admin console by using https://localhost:15672/

Click on “tpExchange”

spring_rabitmq_setup5

Then map “tpExchange” with “tpQueue” with some routing key

spring_rabitmq_setup5

Click on “Bind” button

spring_rabitmq_setup7

Now it’s time to start Developing Spring AMQP RabbitMQ Messaging Application!

That’s it all about Spring AMQP RabbitMQ Installation and setup process. We will discuss and develop Spring AMQP RabbitMQ Messaging Example in my coming posts.

Further Reading: Spring AMQP RabbitMQ Example, Apache ActiveMQ

Reference: Official Website

By admin

Leave a Reply

%d bloggers like this: