RABBITMQ 3.12.1

The RabbitMQ is the main broker used for communication between DSW and the new standalone ODIL.

Having an issue not explained here? Take a look at the F.A.Q.


Installation

You can install the broker natively following the documentation on https://www.rabbitmq.com/install-windows.html. Make sure that you enable the RabbitMQ Management plugin as well.

However, there is also an OneDealer-maintained repo, that contains the necessary configuration to deploy the broker as a Docker container. RabbitMQ Management is included. Read the README.md for more info.

For local development, it is strongly recommended to use the Docker container.

Post-installation

After the installation, login to the management interface by visiting http://localhost:15672/. Use guest:guest as default credentials.

If you want to give remote access to the management interface, make sure you allowed access to 15672 port and create a new user. For security, the default guest:guest credentials only work locally.

Keep in mind that rabbitmqadmin, connects to the Management plugin API on 15672. To test the connection on 5672 use telnet hostname 5672. The following message appears if the port is not accessible:

You may need to enable the telnet client in Windows Features

Management

Start/Stop/Restart the broker

On native Windows installations, on C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\RabbitMQ Server a list of shortcuts should be available.

Simply run RabbitMQ Service - stop to stop the broker and RabbitMQ Service - start to start it.

On Docker installations, use the Start/Stop/Restart container buttons in Docker Desktop:

or, if you do not have Docker Desktop installed, use:

  • docker ps to list all docker containers. If the container is stopped, use docker ps -a to view all containers
  • docker stop <container-name-or-id> to stop the container
  • docker start <container-name-or-id> to start the container
  • docker restart <container-name-or-id> to restart the container

e.g.

Create a new user

While the pre-created guest user is an admin, it is only accessible locally. If you do not have local access to the broker, contact IT.

Any new user you create will be remotely available too

You can create a new user by either the Management UI (Browser) or the RabbitMQ CLI

To see how you can create a new user via the CLI, view the CLI documentation below.

To create the user via the UI, log in to https://<hostname>:15672/#/users and expand the Add a User panel.

Add the user credentials. If you create a user that only needs to connect to the MQ, there is no need to add any tags.

Click on Add User.

Click on the newly created user to go to the User Management screen.

At the Set Permision section, click on the Set permission button.

In the case there are multiple vhosts, make sure you choose the right one

Congratulations! You have created a new user.

CLI

View the official RabbitMQ documentation for more details.

Via Docker


The broker comes with a CLI. If you use the container, simply connect to it and it should be available as a terminal command.

If you do not have Docker Desktop, use docker ps to view all of your containers, and then docker exec -it <rabbitmq-container-id> bash

Native

When you installed RabbitMQ natively, on Windows, some links should have been generated. One of them is the "Rabbit MQ Command Prompt" which opens a CMD with C:\Windows\System32\cmd.exe /k cd /d <rabbitmq-installation-directory>\sbin as target. If for some reason you cannot find the above shortcut, simply create a new one with the above as target (make sure you update it to your needs though)

Then you will be able to use the commands as in the Docker container

Useful commands

rabbitmqadmin

Admin tools that communicate with the Management plugin API. Official Documentation.

Use rabbitmqadmin help and rabbitmqadmin help subcommands to see the options and the subcommands available.

list vhosts

Returns all the virtual hosts of the logged-in broker. e.g. rabbitmqadmin -H localhost -u il.team -p password list vhosts

Keep in mind that rabbitmqadmin connects to the RabbitMQ Management Plugin and not the RabbitMQ itself. If you want to test a remote connection, you should use telnet instead.


rabbitmq-plugins

Manipulates the RabbitMQ plugins. Official documentation.

e.g. rabbitmq-plugins enable rabbitmq_management

rabbitmq-diagnostics

Provides info and stats about the broker. Official documentation.

status

Returns various info on the status of the broker. e.g. rabbitmq-diagnostics status


rabbitmqctl

The base RabbitMQ CLI. Official documentation.

add_user

Creates a new user. e.g. rabbitmqctl add_user username password

set_user_tags

Sets tags for the user. e.g. rabbitmqctl set_user_tags username administrator

set_permissions

Sets permissions for the user on a vhost. For example in vhost = /: rabbitmqctl set_permissions -p / username ".*" ".*" ".*"



Related


0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.