rabbitmqrabbitmq-exchangerabbitmqctl

Why do we need routing key in RabbitMQ?


Why do we need routing key to route messages from exchange to queue? Can't we simply use the queue name to route the message? Also, in case of publishing to multiple queues, we can use multiple queue names. Can anyone point out the scenario where we actually need routing key and queue name won't be suffice?


Solution

  • Decoupling queue names from applications is useful for flexibility.