-
Hello, In my projects at work, I have some scenarios where processing messages in order is critical. From my research RabbitMQ guarantees that messages are processed in order only if there is one and only one consumer per queue (https://www.rabbitmq.com/docs/semantics#ordering)
I would like to use RoadRunner and the jobs plugin to implement RabbitMQ workers, but I was wondering if RoadRunner supports restricting one consumer per queue. I was also wondering how it works in general in RoadRunner if I configure let's say 4 queues and a pool with 4 workers. Will that configuration guarantee that I will only have one consumer per queue? How about scenarios where for one queue I need to have only one consumer but for other queues I may need more than one because I don't care about the message processing order? Also from my research I've read about RabbitMQ features like exclusive consumer (https://www.rabbitmq.com/docs/consumers#exclusivity) and single active consumer (https://www.rabbitmq.com/docs/consumers#single-active-consumer). Are these supported in RoadRunner? As I understand at least with single active consumer, RabbitMQ will take care that there's only one consumer, but was wondering if there's something I need to be aware of on RoadRunner's side - traps and pitfalls type of thing. Thank you in advance for any insight you may offer into these questions |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
Hey @shieldz80 👋 |
Beta Was this translation helpful? Give feedback.
Hey @shieldz80 👋
If you specify a pipeline with a queue, RR will allocate only one consumer. However, you should specify a prefetch of 1 to synchronously consume messages. So, only after the message was acknowledged, RR will consume the next one.
And yes, RR supports exclusive consumers: https://docs.roadrunner.dev/docs/queues-and-jobs/amqp