RabbitMQ is a message broker for asynchronous communication between services.
Producers publish messages to queues/exchanges, and consumers receive/process them.
flowchart LR
Producer([Producer]) -->|:5672| Exchange[Exchange]
Exchange --> Queue[Queue]
Queue --> Consumer([Consumer])
Admin([Admin]) -->|:15672| UI[Management UI]
- Producers publish messages to RabbitMQ.
- RabbitMQ routes messages to queues based on exchange/binding rules.
- Consumers subscribe to queues and process messages.
- The management UI lets you inspect queues, exchanges, connections, and rates.
- Image:
rabbitmq:3-management - Container name:
rabbitmq - Hostname:
rabbitmq - AMQP port:
5672 - Management UI:
http://<host-ip>:15672
Set via .env (copy from .env.example):
RABBITMQ_DEFAULT_USER(default example:admin)RABBITMQ_DEFAULT_PASS(default example:admin)
From the repository root:
cd rabbitmq
cp .env.example .env
docker compose up -dOpen:
- RabbitMQ UI:
http://localhost:15672
Login using values from .env.
Useful commands:
docker compose ps
docker compose logs -f
docker compose restart
docker compose down- Create queues/exchanges from the management UI for quick testing.
- Use the
examplefolder scripts as a basic producer/consumer demo. - Monitor unacked and ready message counts to detect backlogs.
- Change default credentials before exposing RabbitMQ externally.
- Port
5672should be reachable by app containers/services that publish or consume.