- RabbitMQ message broker that implements Advanced Message Queuing Protocol (AMQP). AMQP standardizes messaging using Producers, Broker and Consumers.
- Written in Erlang
- Provides reliability, routing, clustering and high availability, management web interface, command line interface
- Platform agnostic and supports many client libraries in different programming languages
In AMPQ a producer produces a message and sends it to an exchange. The exchange forwards the message to a queue. The consumer will than pick up a message and consume it.
- Producer emits message to exchange.
- Consumer receives messages from queue using binding key
- Exchange compares routing key with binding key.
- Message distribution depends on exchange type
- Exchange types: fanout, direct, topic, and headers.
- Name – The name of the exchange
- Durability – persisting the messages to disk
- Auto-Delete – Delete message when not needed
- Arguments – These are message broker-dependent
- Fanout – sends every message to every queue it knows about.
- Direct – sends message to routing queue based on key.
- Topic – sends message based on partial match to routing queue
- Header – Message header is used instead of routing key
- Default (nameless) – uses routing queue name as key instead of routing key
- By default hosted at http://localhost:15672
- username guest / password guest
- “A happy rabbit is an empty rabbit” – aim to keep queue lengths short
- The queue is rabbit’s basic unit of concurrency
- The “Transfer of Responsibility” Notion – know who is responsible for a message at any given point
- Consumers should eat not nibble – when possible consumers should take a batch of messages instead of one
- Know costs of guarantees and don’t overpay unnecessarily