Integration / RabbitMQ Interview Questions
What is a routing key?
A routing key is a string attribute attached to a message when it is published, which the exchange uses to decide where the message should go.
Its meaning changes with the exchange type:
- Direct exchange - must match a binding key exactly.
- Topic exchange - matched against a dot-separated pattern such as
logs.error.*. - Fanout exchange - ignored completely.
- Headers exchange - not used at all; headers take its place.
A common convention is a dotted hierarchy like order.created.us, which lets topic exchanges route with fine granularity.
More Related questions...