Craftsman at Work

I'm Artur Karbone, coding software architect and independent IT consultant and this is my blog about craftsmanship, architecture, distributed systems, management and much more.

Learn RabbitMQ: Setting up the Environment

We are going to leverage Docker to bootstrap our RabbitMQ environment and keep our development machine as clean as possible at the same time:

docker run -d --name myrabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management

In the command above we are running the container in daemon mode (in background) via -d option, do port forwarding between the host machine and the container via -p (5672 for talking to Rabbit, 15672 in order to open Management Plugin). We also assign a meaningful name via --name option. In addition to that 3-management image tag means that Management Plugin will be enabled out of the box.

We can start/stop the RabbitMQ container later on running the following commands:

docker stop myrabbit

docker start myrabbit

In order to connect to the instance and execute some commands out there do the following:

docker exec -it myrabbit bash

From there you can figure out where the Rabbit is located:

which rabbitmqctl

Being inside the container you can execute various management commands like enabling/disabling plugins:

rabbitmq-plugins enable rabbitmq_management

rabbitmq-plugins disable rabbitmq_management

Starting/stopping the service:

rabbitmq-server start

rabbitmqctl stop

Querying the status:

rabbitmqctl status

Etc.

comments powered by Disqus