

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Exchanges and Queues
incomplete
2: Types of Exchanges
incomplete
3: Create a Queue
incomplete
4: Transient Queues
incomplete
5: Decoupling
incomplete
6: Client REPL
incomplete
7: Sync vs. Async
incomplete
8: Topic Exchange
incomplete
9: Durable
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
RabbitMQ supports several types of exchanges, each serving a different routing strategy.
In my experience, direct and topic are the most commonly useful in backend Pub/Sub architectures. I rarely have a use for sending all messages to all queues, or for routing based on the message headers.
We'll talk more about the intricacies of routing keys later.
Direct: Messages are routed to the queues based on the message routing key exactly matching the binding key of the queue.
Topic: Messages are routed to queues based on wildcard matches between the routing key and the routing pattern specified in the binding.
Fanout: It routes messages to all of the queues bound to it, ignoring the routing key.
Headers: Routes based on header values instead of the routing key. It's similar to topic but uses message header attributes for routing.