Asynchronous - decoupling applications by separating sending and
Reliability - persistence, delivery acknowledgements, publisher confirms,
and high availability
Flexible Routing - messages are routed through exchanges before
arriving at queues
Highly Available Queues - queues can be mirrored across several
machines in a cluster
Multi-protocol - RabbitMQ supports messaging over a variety of
Many Clients - there are RabbitMQ clients for almost any language
Management UI - RabbitMQ ships with an easy-to use management UI
Plugin System - RabbitMQ ships with a variety of plugins extending it in
different ways, and you can also write your own.
Producing - means just sending. A program that sends
messages is a producer.
Queue is the name for a mailbox. It lives inside RabbitMQ.
Messages can be stored only inside a queue.
Consuming - receiving. A consumer is a program that mostly
waits to receive messages.
So RabbitMQ just accepts messages from producers, and
delivers them to consumers
But it can also route, buffer, and persist the messages
according to rules you give it.
A worker process running in the background will pop the tasks
and eventually execute the job
Made for easily parallelise work. We can add more workers at
any time and that way, scale easily
Let’s see how it works
Once RabbitMQ delivers a message to the customer it
immediately removes it from memory
But what will happened if the message goes to worker and will
not process correctly?
An ack(nowledgement) is sent back from the consumer to tell
RabbitMQ that a particular message has been received,
processed and that RabbitMQ is free to delete it.
• ack is disabled by default, you can enable it like this:
:manual_ack => true
ch.queue("hello", :durable => true)
The core idea in the messaging model in RabbitMQ is that the
producer never sends any messages directly to a queue, it’s
send it to exchanges
sudo rabbitmqctl list_exchanges
The routing algorithm behind a direct exchange is simple - a
message goes to the queues whose binding key exactly
matches the routing key of the message
Topic exchanges route messages to one or many queues
based on matching between a message routing key and the
pattern that was used to bind a queue to an exchange.
The topic exchange type is often used to implement various
publish/subscribe pattern variations.
* (star) can substitute for exactly one word.
# (hash) can substitute for zero or more words.
It just broadcasts all the messages it receives to all the queues