RabbitMQ — Reliable Open-Source Message Broker
RabbitMQ is one of the most popular open-source message brokers, implementing AMQP, MQTT, STOMP, and more. Used by thousands of companies for reliable async messaging, RPC, pub/sub, task queues, and microservice communication.
Instalación lista para agent
Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.
npx -y tokrepo@latest install 90136d3b-35f6-11f1-9bc6-00163e2b0d79 --target codexEjecutar después de confirmar el plan con dry-run.
What it is
RabbitMQ is one of the most widely deployed open-source message brokers. Built on Erlang/OTP, it implements the Advanced Message Queuing Protocol (AMQP) as its primary protocol and also supports MQTT, STOMP, HTTP, and WebSocket. It handles async messaging, task queues, pub/sub patterns, RPC, and microservice communication.
RabbitMQ suits backend teams that need reliable message delivery between services. It runs on Linux, macOS, and Windows, with official Docker images and Kubernetes operators available.
How it saves time or tokens
RabbitMQ decouples producers from consumers, letting services scale independently. Instead of polling or blocking on synchronous HTTP calls, services push messages to queues and move on. Failed consumers retry automatically with configurable dead-letter exchanges. This eliminates manual retry logic and reduces wasted compute on failed operations.
How to use
- Run RabbitMQ with Docker using the management plugin for the web UI.
- Connect a producer using the
pikalibrary (Python) or any AMQP client. - Connect a consumer that processes messages and acknowledges them.
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 \
-e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin \
rabbitmq:3-management
Example
A Python producer sending a persistent message to a durable queue:
import pika
conn = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = conn.channel()
channel.queue_declare(queue='tasks', durable=True)
channel.basic_publish(
exchange='',
routing_key='tasks',
body='process order 42',
properties=pika.BasicProperties(delivery_mode=2),
)
conn.close()
A consumer processing and acknowledging messages:
def callback(ch, method, properties, body):
print(f'Received {body}')
ch.basic_ack(delivery_tag=method.delivery_tag)
channel.basic_qos(prefetch_count=1)
channel.basic_consume(queue='tasks', on_message_callback=callback)
channel.start_consuming()
Related on TokRepo
- AI Tools for DevOps — Infrastructure and operations tools for modern backends
- AI Tools for Self-Hosted — Self-hosted alternatives for common infrastructure
Common pitfalls
- Forgetting to set
durable=Trueon queues anddelivery_mode=2on messages means data loss on restart. - The default
guestuser only works from localhost. Remote connections need a new user created viarabbitmqctl add_user. - Unacknowledged messages accumulate in memory. Always set
prefetch_countto limit how many messages a consumer holds at once.
Preguntas frecuentes
RabbitMQ primarily implements AMQP 0.9.1 and also supports AMQP 1.0, MQTT (for IoT), STOMP (for text-based messaging), HTTP, and WebSocket. Each protocol is enabled through a plugin. AMQP is enabled by default.
RabbitMQ is a message broker focused on routing and delivery guarantees. Kafka is a distributed log optimized for high-throughput event streaming. Use RabbitMQ for task queues, RPC, and complex routing. Use Kafka for event sourcing, log aggregation, and stream processing.
Yes. A single RabbitMQ node handles tens of thousands of messages per second. Clustering and sharded queues scale horizontally. Quorum queues provide replication across nodes for durability without sacrificing throughput.
Yes. RabbitMQ is open source under the Mozilla Public License 2.0. It is free to run and self-host. VMware (Broadcom) offers commercial support and a managed cloud service called CloudAMQP for teams that prefer not to operate it themselves.
RabbitMQ provides official client libraries for Java, .NET, Erlang, and Go. Community-maintained clients exist for Python (pika), Node.js (amqplib), Ruby (bunny), PHP, Rust, and many others. Any AMQP-compliant library works.
Referencias (3)
- RabbitMQ GitHub— RabbitMQ open-source message broker with 13K+ stars
- RabbitMQ Documentation— AMQP protocol specification and RabbitMQ implementation
- Erlang Official Site— Erlang/OTP foundation for RabbitMQ reliability
Relacionados en TokRepo
Discusión
Activos relacionados
Reactive Resume — AI-Powered Open-Source Resume Builder
Free open-source resume builder with AI integration. Supports Claude, GPT, Gemini for content generation. Drag-and-drop, PDF export, self-hostable, privacy-first. MIT, 36,000+ stars.
Webstudio — Open Source Visual Website Builder
Webstudio is an open-source Webflow alternative with a visual drag-and-drop editor, full CSS support, headless CMS integration, and self-hosting on Cloudflare.
Twenty — Open-Source AI CRM (Salesforce Alternative)
Modern open-source CRM with AI features. Custom objects, kanban views, email sync, workflow automation. NestJS + React + PostgreSQL. AGPL-3.0, 43,700+ stars.
Documenso — Open Source Document Signing Platform
Documenso is an open-source DocuSign alternative for self-hosted document signing with PDF e-signatures, audit trails, and Next.js stack.