I use Symfony Messenger with the RabbitMQ adapter in my application. The logic of the application is that messages from the same queue must be executed sequentially, one after the other (the order is not important), even if the queue is listened to by multiple consumers. In other words, the queue should not give out other messages if at least one is unacked.
To solve the problem, I found in the documentation an option such as x-single-active-consumer (https://www.rabbitmq.com/consumers.html#single-active-consumer).
The configuration is like this:
my-queue:
dsn: amqp://guest:guest@localhost:5672/%2f/my-queue
options:
queues:
my-queue:
arguments:
x-single-active-consumer: true
The UI shows that the queue was created with the SAC (single-active-consumer) flag, which confirms that the configuration is correct. However, when several consumers are started, they receive tasks in parallel, without waiting for the previous task to finish, in fact, as if the single-active-consumer flag wasn't set at all.
Can you tell me what I'm doing wrong?