RabbitMQ is an open-source message broker. Producers send messages to an exchange, which routes them to one or more queues according to rules called bindings, and consumers receive messages from those queues. It supports AMQP and several other protocols.
Why it matters
RabbitMQ is a common choice for background jobs, task distribution and service-to-service messaging. Its routing model is flexible: direct exchanges match exact keys, topic exchanges match patterns, and fanout exchanges copy to every bound queue. It supports acknowledgements, durable queues, dead-letter queues and priorities, which help build reliable workers. Unlike Kafka, messages are normally removed after acknowledgement rather than kept as a replayable log.
Example
channel.queue_declare(queue="emails", durable=True)
channel.basic_publish(
exchange="",
routing_key="emails",
body=b'{"to":"a@example.com"}',
properties=pika.BasicProperties(delivery_mode=2),
)
Marking both the queue durable and the message persistent lets them survive a broker restart.
Common mistakes
- Using auto-acknowledge, so a crashing worker loses its message.
- Letting a queue grow unchecked when consumers stall, until memory or disk alarms block publishers.
- Leaving the default guest account or management port exposed.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.