Recall & Review
beginner
What is a Topic Exchange in RabbitMQ?
A Topic Exchange routes messages to queues based on matching between a message routing key and the pattern that was used to bind a queue to the exchange. It uses wildcards for flexible routing.
Click to reveal answer
beginner
What wildcard characters are used in Topic Exchange bindings?
The '*' (star) matches exactly one word, and the '#' (hash) matches zero or more words in the routing key.
Click to reveal answer
intermediate
How does the routing key 'stock.usd.nyse' match the binding key 'stock.*.*'?
The routing key 'stock.usd.nyse' matches 'stock.*.*' because '*' matches exactly one word. Here, 'usd' and 'nyse' each match one '*'.
Click to reveal answer
intermediate
Explain the difference between '*' and '#' in Topic Exchange pattern matching.
'*' matches exactly one word in the routing key, while '#' matches zero or more words, allowing more flexible matching.
Click to reveal answer
beginner
What happens if a message's routing key does not match any binding pattern in a Topic Exchange?
The message is discarded or returned to the sender if no queue binding matches the routing key pattern in the Topic Exchange.
Click to reveal answer
Which wildcard in a Topic Exchange matches zero or more words?
✗ Incorrect
The '#' wildcard matches zero or more words in the routing key pattern.
What does the routing key 'log.error.system' match if the binding key is 'log.*.*'?
✗ Incorrect
Each '*' matches exactly one word, so 'error' and 'system' match the two '*' in 'log.*.*'.
If a queue is bound with 'sensor.#', which routing key will NOT match?
✗ Incorrect
'device.sensor.temperature' does not start with 'sensor', so it does not match the binding key 'sensor.#'.
What type of exchange uses pattern matching with wildcards '*' and '#'?
✗ Incorrect
Topic Exchange uses routing keys with '*' and '#' wildcards for pattern matching.
Which binding key would match routing keys with exactly three words starting with 'app'?
✗ Incorrect
'app.*.*' matches routing keys with three words where the first word is 'app'.
Describe how the '*' and '#' wildcards work in RabbitMQ Topic Exchange pattern matching.
Think about how many words each wildcard can match in the routing key.
You got /3 concepts.
Explain what happens when a message is sent to a Topic Exchange with a routing key that does not match any queue binding.
Consider how routing keys and binding keys interact in message delivery.
You got /3 concepts.