Skip to main content
Matrix42 Self-Service Help Center

Service Bus I: RabbitMQ

About this document

This document describes the first steps needed for successfully deploying RabbitMQ as a message broker. Please also review the alternative Microsoft Azure Service Bus which is provided as a cloud service and does not require any local implementation. For a more in-depth guide on configuring the RabbitMQ Server, please refer to the official RabbitMQ manual.

Overview

RabbitMQ is a message-queueing software also known as a message broker or queue manager. Simply said; it is software where queues are defined, to which applications connect in order to transfer messages. RabbitMQ is particularly interesting for a on premise deployment of a message-queueing software, as it allows you to enjoy all the benefits of a fully-fledged message-queueing software, without the involvement of third-party services in the cloud. Below, you can see an abstract overview of the way platforms are connected to RabbitMQ, enabling them to securely and remotely communicate with each other.

RabbitMQ.PNG

Prerequisites and Package Content

Firewall Settings

Firewall settings - which Ports are used by RabbitMQ

  • 5672, 5671: used by the protocol AMQP 0-9-1 and 1.0 clients with and without TLS
  • 15672: HTTP API clients, management UI and rabbitmqadmin (only if the management plugin is enabled)

Download 

Package content

  • The downloaded RabbitMQ getting started package contains:
    • RabbitMQ Server 3.9.5 for 64bit Windows system
    • Erlang OTP 24.0
      • TTP is a set of Erlang libraries and design principles providing middle ware to develop these systems. It includes its own distributed database, applications to interface towards other languages, debugging and release handling tools. It is a pre-requisite for the RabbitMQ server
    • Matrix42 CreateRabbitMqExchangeAndQueues.ps1 PowerShell script

Installation

This chapter contains a step-by-step guide for the automatic deployment of the RabbitMQ message broker. In case you want to perform a manual step-by-step installation, please refer to RabbitMQ Server Manual Installation

Automated Installation and configuration of RabbitMQ Server

The downloaded installation comes as self-extracting package (RabbitMQ_InstallPackage.exe). It allows an automated installation of the required components. Please note that the installation will be placed in the default directories of the corresponding programs. Additionally, the package automatically executes the PowerShell script Install-RabbitMqServer.ps1. After the automated installation, the RabbitMQ server will also be configured with default values for exchanging messages - except the username and its password (those will be asked during the script execution). In detail these parameters are:

VirtualHost matrix42
ExchangeName matrix42.suem.topic
EmpirumQueueName matrix42.empirum.subscription
ServiceStoreQueueName matrix42.uux.subscription
SilverbackQueueSubscription matrix42.silverback.subscription

Each connected system needs its own queue as it consumes and removes the messages. Having multiple subscribers on one queue will result in not received messages. If additional systems should be connected the queues need to be added manually.

When installing the RabbitMQ Server on the same server as Empirum make sure that the Matrix42 Empirum Service Bus Service is set for delayed startup.

The default connection string based on this installation and configuration will look like this:

amqp://<username>:<password>@<FQDN of your RabbitMQ Server>/matrix42

If you want to install all components semi-automated, please extract the compressed file RabbitMQ_InstallPackage.exe, change the current directory to the package root and execute the script as shown below. You must execute the script as Administrator.

.\Install-RabbitMqServer.ps1

The script will install Erlang, RabbitMQ and the RabbitMQ Management Plugin.
After execution you can login to the management web UI of running RabbitMQ service on the localhost.

http://localhost:15672

Login as user ‘guest’ with password ‘guest’ as default credential.

Don’t forget to change the guest password or disable the guest user entirely (latter is recommended). This user must only be used during installation from and to localhost (https://www.rabbitmq.com/access-control.html).

Add additional queues (optional)

By default queues for the Digital Workspace Platform (Service Store), Empirum and Silverback are created. Additionally required queues can be created manually by logging in to the RabbitMQ management console:

  • Select Queues
  • Select "matrix42" in the Virtual Hosts drop down
  • Type in a name like "matrix42.egocesure.subscription" in the name field
  • Click on TTL and enter 2419200000 in the value field (this is the time in milliseconds how long messages stays in the queue if no one rerieves them)
  • Click on "Add Queue"
  • Select the new queue in the table
  • Expand "Bindings"
  • Enter the exchange name i.e. "matrix42.suem.topic" in the "From exchange" field
  • Click add binding

Additional Information

Question: I created a queue that needs to be removed, how to delete the queue?

A queue can be deleted from the RabbitMQ Management Interface. Go to the queue tab and go to the bottom of the page. You will find a dropdown "Delete / Purge". Press Delete on the left side of the interface to delete the queue. For other possible ways of deleting queues you can consult the official RabbitMQ documentation.

Question: Are messages persistent and survive a Server/RabbitMQ Service Restart?

By default the messages are processed and removed. The default queue setting is non persistant and restarting the service will remove all unprocessed messages.

Next Steps

  • Was this article helpful?