Kafka, RabbitMQ & Queues
Direct routing
A direct exchange sends each message to queues whose binding key matches the routing key exactly, so a difference in case or spacing silently sends the message nowhere.
What you will be able to do
- Explain how a direct exchange matches a routing key to binding keys.
- Decide when a direct exchange fits a fixed set of keys and when it does not.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in Kafka, RabbitMQ & Queues
- Dead letter queuesAdvanced · 4 min
A dead letter exchange catches messages that are rejected, expired, overflowed or redelivered too often, so failed work is kept for inspection instead of being lost.
- RabbitMQ exchangesAdvanced · 4 min
In RabbitMQ, publishers send to an exchange, and bindings decide which queues receive a copy, so a successful publish does not prove that any queue got the message.
- Topic routingAdvanced · 4 min
A topic exchange routes by matching the words of a dotted routing key against patterns, where star matches one word and hash matches zero or more, so word count decides…
- Fanout routingAdvanced · 4 min
A fanout exchange copies every message to every bound queue and ignores the routing key, which suits events many services need in full, but each extra binding adds a…
- Quorum queuesAdvanced · 4 min
A quorum queue replicates each message to several nodes and commits it once a majority stores it, which keeps confirmed messages through a node failure at the cost of…
- Consumer acknowledgmentsAdvanced · 4 min
A manual ack tells the broker that a consumer finished the work, so until that ack arrives the broker holds the message and returns it to the queue if the consumer dies.