Setup RabbitMQ

Rojina
by Rojina 
Introduction

RabbitMQ is used for message queuing. Various services in MPS use rabbitmq to pass messages among each other.

Instructions

RabbitMQ can be installed directly or run via docker container. We need to enable the management plugin for rabbitmq.

Steps for installing and configuring rabbitmq:

  1. Install from repository:

    • apt install rabbitmq-server
  2. Create administrator user

    • rabbitmqctl add_user admin adminpassword
    • Syntax: rabbitmqctl add_user admin adminpassword
    • The above command creates a user admin with password adminpassword. Change it as per requirement
  3. Grant administrator privilege to the user that was just created

    • rabbitmqctl set_user_tags admin administrator
    • The above command sets administrator tag to the user admin
  4. Grant permission to vhost “/” for the created user

    • rabbitmqctl set_permissions -p / admin “.*” “.*” “.*”

**Note:** ‘admin’ is the sample administrator username used in this article. You can use any username you want.

**Note:** If you are using AWS, make sure to open the required ports.

**Note:** If you are using Docker containers for rabbitmq, make sure to forward the ports as per requirements

rabbitmq.png

Fig:RabbitMQ Web Login page

  1. Rabbitmq official installation guide
  2. Official Rabbitmq management plugin article
  3. [https://hub.docker.com//rabbitmq](https://hub.docker.com//rabbitmq)