Building Blocks
A Visual and Interactive Guide to RabbitMQ Routing
Understand RabbitMQ Exchanges, Queues, and Bindings through interactive simulators.
— 5 min read — 4 interactive simulators
Building Blocks
Understand RabbitMQ Exchanges, Queues, and Bindings through interactive simulators.
— 5 min read — 4 interactive simulators
How does a message sent by one service reach the right recipient in a distributed architecture? You install , open the docs, and immediately run into: , , , .
In this article, we'll understand each of these terms through interactive simulators.
But first, an important point.
In RabbitMQ, a has no idea which exist. It doesn't send a message to a . It sends it to an . The decides where it goes.
Think of a post office. When you drop a letter in a mailbox, you don't drive it to the recipient's house. You hand it to the postal service (the ), which reads the address (the ) and puts it in the right delivery truck (the ). A then picks up the message from the and processes it.
The simplest type. A message with pdf_create goes to the whose has the pdf_create. A is the link between an and a . It tells the "send matching messages here." Exact match, nothing more. If no matches, the message is silently dropped.
A ignores the entirely. It copies every message to every bound to it.
No address needed. Every truck gets a copy.
Use it when an event concerns all your services: a cache invalidation, a config reload, a global alert.
A matches against using dot-separated words and two wildcards:
* matches exactly one word# matches zero or more wordsSo logs.error.auth would match logs.*.auth and logs.#, but not logs.error.
* and # wildcards for pattern-based routing. The most expressive, with the most pitfalls.This article is part of the "Building Blocks" series.