0
0
RabbitMQdevops~20 mins

Topic exchange (pattern matching) in RabbitMQ - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Topic Exchange Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Routing key matching with topic exchange
Given a topic exchange with a binding key stock.*.nyse, which routing key will cause a message to be delivered to the queue?
Astock.tech.nyse
Bstock.nyse
Cstock.tech.nyse.extra
Dstock.nyse.tech
Attempts:
2 left
💡 Hint
Remember that * matches exactly one word in the routing key.
🧠 Conceptual
intermediate
1:30remaining
Understanding the '#' wildcard in topic exchanges
What does the # wildcard represent in a RabbitMQ topic exchange binding key?
AMatches only the last word in the routing key
BMatches exactly one word in the routing key
CMatches only the first word in the routing key
DMatches zero or more words in the routing key
Attempts:
2 left
💡 Hint
Think about how many words # can match.
🔀 Workflow
advanced
2:30remaining
Configuring multiple bindings for selective message routing
You want to route messages with routing keys log.error.system and log.error.application to a queue named ErrorLogs. Which binding keys should you use on the topic exchange to achieve this?
Alog.error.*
Blog.*.error
Clog.#.error
D*.error.*
Attempts:
2 left
💡 Hint
Consider the position of the wildcard and the routing key words.
Troubleshoot
advanced
2:00remaining
Why messages are not routed as expected
A queue is bound to a topic exchange with the binding key sensor.#. Messages with routing key sensor are not delivered to the queue. What is the most likely reason?
AThe queue is not properly bound to the exchange
BThe binding key 'sensor.#' only matches routing keys with exactly two words
CThe routing key must have at least one word after 'sensor' to match 'sensor.#'
DThe '#' wildcard does not match zero words, only one or more
Attempts:
2 left
💡 Hint
Check how the '#' wildcard behaves with zero words.
Best Practice
expert
3:00remaining
Optimizing topic exchange bindings for performance
Which practice helps improve performance when using topic exchanges with many bindings and high message throughput?
AUse fanout exchanges instead of topic exchanges for all routing needs
BUse more specific binding keys with fewer wildcards to reduce routing overhead
CUse only '#' wildcards in all bindings for maximum flexibility
DBind all queues with the same binding key to simplify routing
Attempts:
2 left
💡 Hint
Think about how routing keys and bindings affect message routing speed.