We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

RabbitMQ

A message broker is a middleman that allows different parts of the system to communicate without knowing about each other. Everyone is friends with the message broker, and the message broker is friends with everyone.

What Is RabbitMQ?

RabbitMQ is a popular open-source message broker that implements the AMQP protocol and I've personally been using it happily (well, mostly happily) for years. It's great because it's open-source, flexible, powerful, and (reasonably) easy to use. There are a few things we're going to use to interact with RabbitMQ:

  1. The RabbitMQ server: The message broker itself. It's a server you can run locally (or on a server in production) to send and receive messages.
  2. Client library: We'll be programming in Go, so our code will use the AMQP library to interact with the RabbitMQ server.
  3. Management UI: RabbitMQ comes with a management UI that you can use to monitor and manage your RabbitMQ server. It's a web-based UI that you can access in your browser.

Click to play video

Assignment

Let's get Rabbit 3.13.0 (or higher) installed locally. For simplicity, we're going to use Docker If you're brand new to Docker, you might want to check out our Docker course first.

Run this command in a terminal to start RabbitMQ:

docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3.13-management

This will download and run the RabbitMQ server and ManagementUI until you kill it with Ctrl+C, so you might want to do it in a separate terminal window.

The server itself is running on port 5672, but you won't interact with it in your browser, just through code. However, you can use the management UI in your browser. Open http://localhost:15672 and log in with the username guest and password guest.

If all is well, you should see that you have a single "Node" running in the "Overview" tab. You can shutdown the Docker container when you're done with Ctrl+C.

Run and submit the CLI tests using the Boot.dev CLI Tool while the docker container is still running.