OntoPop
Search…
⌃K

RabbitMQ

Install and configure a self-managed RabbitMQ service for development and testing purposes.
Last Updated: 07 February 2022 • Page Author: Jillur Quddus

Overview

RabbitMQ is an open-source enterprise message broker. This page provides instructions on how to install and configure a self-managed RabbitMQ service for development and testing purposes only (i.e. non-production).
This page provides instructions on how to install and configure a self-managed RabbitMQ service for development and testing purposes only. To configure a secure production-ready instance of RabbitMQ, please refer to the RabbitMQ server documentation.
The instructions below are for Ubuntu 20.04. Installation instructions for other Linux distributions and Windows may be found at https://www.rabbitmq.com/download.html.

Installation

Please run the following commands via your command line to install RabbitMQ server and all required dependencies.
# Install dependencies if required
$ sudo apt-get install curl gnupg apt-transport-https
# Add the RabbitMQ repository
$ curl -1sLf "https://keys.openpgp.org/vks/v1/by-fingerprint/0A9AF2115F4687BD29803A206B73A36E6026DFCA" | sudo gpg --dearmor | sudo tee /usr/share/keyrings/com.rabbitmq.team.gpg > /dev/null
$ curl -1sLf https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/io.cloudsmith.rabbitmq.E495BB49CC4BBE5B.gpg > /dev/null
$ curl -1sLf https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/gpg.9F4587F226208342.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/io.cloudsmith.rabbitmq.9F4587F226208342.gpg > /dev/null
$ sudo tee /etc/apt/sources.list.d/rabbitmq.list <<EOF
## Provides modern Erlang/OTP releases
##
deb [signed-by=/usr/share/keyrings/io.cloudsmith.rabbitmq.E495BB49CC4BBE5B.gpg] https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/ubuntu focal main
deb-src [signed-by=/usr/share/keyrings/io.cloudsmith.rabbitmq.E495BB49CC4BBE5B.gpg] https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/ubuntu focal main
## Provides RabbitMQ
##
deb [signed-by=/usr/share/keyrings/io.cloudsmith.rabbitmq.9F4587F226208342.gpg] https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/ubuntu focal main
deb-src [signed-by=/usr/share/keyrings/io.cloudsmith.rabbitmq.9F4587F226208342.gpg] https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/ubuntu focal main
EOF
# Install Erlang dependencies
$ sudo apt-get update
$ sudo apt-get install -y erlang-base erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key erlang-runtime-tools erlang-snmp erlang-ssl erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl
# Install RabbitMQ server
$ sudo apt-get install rabbitmq-server --fix-missing
To configure RabbitMQ server to start on-boot, please run the following command via your command line:
# Configure RabbitMQ server to start on-boot
$ sudo systemctl enable rabbitmq-server

Starting RabbitMQ

To start RabbitMQ server, please run the following command via your command line:
# Start RabbitMQ server
$ sudo systemctl start rabbitmq-server

Managing RabbitMQ

By default, RabbitMQ will listen on port 5672 on all available network interfaces. To administrate RabbitMQ, please refer to the RabbitMQ administration guide which may be found at https://www.rabbitmq.com/admin-guide.html.
For the purposes of development and testing, below are some basic commands that allow developers to check the status of the RabbitMQ instance:
# Check that the local node is running and CLI tools can successfully authenticate with it
$ sudo rabbitmq-diagnostics ping
# Show the status of RabbitMQ including TCP listeners and memory usage
$ sudo rabbitmq-diagnostics status

Administration Tool

The RabbitMQ administration tool may be installed via the RabbitMQ plugins feature, as follows:
# Install the RabbitMQ administration tool
$ sudo rabbitmq-plugins enable rabbitmq_management
The RabbitMQ management interface, allowing administrators to view and configure connections, channels, exchanges, queues, virtual hosts, users and policies, is available at http://localhost:15672 with the default username of "guest" and default password of "guest".

OntoPop Context

To configure OntoPop to use RabbitMQ, please configure the spring.cloud.stream.binders.rabbitmq namespace in application.yml as follows:
Property
Description
Example Value
host
RabbitMQ hostname. Note that the hostname should be set as an externalized variable and NOT stored as plaintext in application.yml.
localhost
port
RabbitMQ port. Note that the port should be set as an externalized variable and NOT stored as plaintext in application.yml.
5672
username
RabbitMQ username. Note that the username should be set as an externalized variable and NOT stored as plaintext in application.yml.
guest
password
RabbitMQ password. Note that the password should be set as an externalized variable and NOT stored as plaintext in application.yml.
guest
virtual-host
Rabbit MQ virtual host.
/
ssl.enabled
Whether communication is secured by SSL.
false
For further information regarding configuring the Spring Cloud Stream RabbitMQ binder, please visit https://docs.spring.io/spring-cloud-stream-binder-rabbit/docs/current/reference/html/spring-cloud-stream-binder-rabbit.html.
Last modified 11mo ago