codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Follow publication

Get Started with RabbitMQ on Docker

How to quickly spin up RabbitMQ instances with Docker and Docker Compose.

Changhui Xu
codeburst
Published in
6 min readMay 26, 2020

Get Started with RabbitMQ on Docker

RabbitMQ (link) is the most widely-deployed open source message broker. A message broker is a computer program module that exchanges messages between the message producers and consumers, thus is able to effectively decouple different software components. RabbitMQ is lightweight and easy to deploy on premises and in the cloud. Moreover, its official tutorials are extremely easy to follow.

In this article, we will talk about how to quickly spin up RabbitMQ instances on Docker. We will go through two ways to run a RabbitMQ Docker image in a container: (1) using the docker run command; (2) using Docker Compose. Getting familiar with these two approaches should greatly accelerate your learning on RabbitMQ.

I will not talk about any RabbitMQ client code here, because the official tutorials have already done an awesome job in explaining code details in different scenarios. For your information, the demos in this article are written in .NET (should be transferable to other languages), and the complete code can be found in my GitHub repository.

Now let’s dive into the world of RabbitMQ and Docker.

Using the RabbitMQ Docker Image

The RabbitMQ container registry (link) includes a variety of images for different platforms. In this article, we will use the RabbitMQ image with a tag 3-management, which is a Docker image with the RabbitMQ management plugin installed and enabled by default.

Assuming the Docker Desktop has been installed, we use the command docker pull rabbitmq:3-management to pull a RabbitMQ Docker image from DockerHub. After the Docker image is downloaded and saved locally, we can start a RabbitMQ container using the following command.

In the command above, the port 5672 is used for the RabbitMQ client connections, and the port 15672 is for the RabbitMQ management website. This…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Published in codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Written by Changhui Xu

Lead Application Developer. MBA. I write blogs about .NET, Angular, JavaScript/TypeScript, Docker, AWS, DDD, and many others.

Responses (3)

Write a response

Hey Changhui Xu, this is an awesome post. I got it to work in like 5 mins. That's a testament to how well you have this written and your Github repo setup.
I'm trying to figure out how to turn off the autoDelete attribute on the queue, cause I just…

--

Thank you very much! The tutorial is simple and straight to the point.

--

Hello there 🤗
What does `@my-rabbit` do? 🤔

--