With AMQP, you post messages to Exchange, and you consume messages from the queue. Don't worry about what βqueueβ means in another messaging technology.
It seems to me that your script can be easily handled by a topic exchange. Publish messages using routing keys such as cat.silly, cat.older, cat.interesting. Consumers then queue using the bind key. *
Thus, all messages published in exchange with any prefix will be copied to the queue due to the template in the binding key. If your consumers are actually sharing, that is, messages should not be copied to multiple queues, then just all consumers use the same queue name. If each consumer uses the same queue name, you can compile it into your code and not worry about what the name is. But when you want to debug a message flow, just create a user who subscribes to a queue named catdebug with the same binding key, cat. *
But if each consumer specializes and wants to choose which messages to process, then each consumer uses a unique queue name. Thus, each consumer will see a copy of each message.
Tag exchange is the best solution for the first attempt, because the semantics of direct and branched exchanges can be easily emulated.
source share