I'm very new to RabbitMQ and I need to write a program that has Multi Producer and multi consumer with a single queue. Is this possible to do what I've shown in the image? I found lots of examples but they are all with single producer. Any producer send messages to any consumer.
In RabbitMQ, we can have multiple consumers listening from one queue. This is good for fast procesing, but not so good for message ordering.
It is not possible.
Multiple producers can publish to the same exchange - or directly to a single queue via the built-in direct exchange. You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
Support for multiple-consumer queues is a Message Queue feature (the JMS specification defines messaging behavior in the case of only one consumer accessing a queue). When multiple consumers access a queue, the load-balancing among them takes into account each consumer's capacity and message processing rate.
In short, the answer is absolutely you can have many producers that publish to a single queue. I would recommend that you create an exchange and have your producers send things into an exchange which then forwards to a queue. In your simple diagram an exchange is not strictly necessary but it makes your solution more extensible in the future.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With