We\'ve got an application which will be using RabbitMQ and have several different queues for passing messages between tiers.
Initially, I was planning to use multiple di
Indeed approach 2 is better as it gives you flexibility to use a single queue for multiple routing keys.
Exchange Topic
QueueA-- binding key = India.Karnataka.*
You can route a message to topic exchange with routing key as India.Karnataka.bangalore,India.Karnataka.Mysore.
All the above messages goes to QueueA.
Direct Exchange
But I did not understand on why are you creating multiple direct exchanges in approach 1. You can have single direct exchange and have multiple queues with each queue binding with a unique key.
QueueA-- binding key = Key1
QueueB-- binding Key = Key2
QueueC-- binding Key = Key3
All key1 messages goes to QueueA.Key2 goes to QueueB ... You can still maintain single direct exchange.