Craftsman at Work

I'm Artur Karbone, coding software architect and independent IT consultant and this is my blog about craftsmanship, architecture, distributed systems, management and much more.

Learn RabbitMQ: The Terminology

RabbitMQ is a message broker: it accepts and forwards messages via exchanges to queues. A post office analogy comes to my mind here. Where an envelope is a message, a destination postbox is a queue and the post office itself is a routing/delivery mechanism.

Hold on. A lot of buzzwords already. RabbitMQ uses some terminology or jargon if you will. Let's demystify it:

Producing means sending messages. A piece of code that sends messages is a producer.

A Queue is a post box, where messages are piled up.

Under the hood, we are sending messages, not to the queues directly, rather to Exchanges, that basically are routers (meaning they know to which queue or queues to dispatch the messages). The same as in the post office. You just fill out an envelope. You don't have to write down exact steps/instructions on how to deliver the envelope, the post office will do the routing for you.

Consuming means receiving. A consumer is a piece of code that monitors a queue for messages, picks them up and process somehow.

Here is a simplified flow, consisting out of Producer/Queue/Consumer:

The last important concept for today is Binding or rule, which determines how exchanges/queues are interconnected and how the messages sent to exchanges will be routed to queues.

comments powered by Disqus