Rabbitmq: Exchange->routingkey->queue Naming Structure
Solution 1:
For this case, I would recommend using a single exchange to contain all the jobs for the single application, and then use a queue to represent each job type, which can then have multiple consumers (which will then be able to process messages from that queue in a round-robin fashion).
The routing key can then be used to direct the consumers in terms of which job they are processing.
Having only one exchange both makes sense as a logical grouping (i.e. at the app level) and simplifies management/administration/monitoring within RabbitMQ. If you have a new job type, you would need to simply create a new queue & binding and change the routing key, as opposed to having to create a new exchange and then also having to create a new queue & binding.
If later you have an entirely different application, then I would say it's time to create a new exchange for it and then follow the same general model I mention above (assuming it's similarly behaved from a high level).
I think the Routing tutorial on the RabbitMQ website would probably fit your scenario best, if you're looking for additional details (link below is for Python but they have one for C# also).
Post a Comment for "Rabbitmq: Exchange->routingkey->queue Naming Structure"