-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SAC not working properly #106
Comments
Hey there 👋
I added the following lines to your consumer code to declare the queue. Please note that queueArgs := make(amqp091.Table)
queueArgs["x-single-active-consumer"] = true
queue, err := ch.QueueDeclare("queue",
true, // durable
false, // auto delete
false, //exclusive
false, //noWait
queueArgs, // queue args
)
if err != nil {
panic(err)
} Edit: I can reproduce the issue, see #106 (comment) |
Thanks to reply. When I try again, I got the same problem. |
I can confirm that the problem seems to be in RabbitMQ. The queue crashes for some reason, and the consumer does not take over. Edit: I can reproduce the behaviour of the queue crash when both consumers are attached to the queue before the producer starts publishing. If the producer is already running, there's no queue crash. This is a CQ. Verified this in RabbitMQ 3.10.6, current |
Thank you. Is there any plans to fix it? |
@laststem You can try to use a quorum queue (SAC implementation is different between classic queues and quorum queues) and stick to it if you don't reproduce the issue and quorum queue is an acceptable type of queue for your use case. |
@Zerpet Can you reference or create an issue on the broker repository so we can keep track of this issue? Thanks. |
Thanks to reply. @acogoluegnes I can't use quorum queue because there is constraint that queue have only one consumer. currently, we use classic queue with exclusive flag. (1 Queue - 1 Consumer) if we use quorum queue, it can provide high availability, but doesn't meet constraint. (1 Queue - N Consumer) |
@laststem Quorum queues support single active consumer, so you make sure that only 1 consumer consumes at a time. You enable it just like with a classic queue. Sorry I was not clear in my first comment, I meant "try with a quorum queue with single active consumer enabled". |
Good! I will try. thank you @acogoluegnes |
rabbitmq/rabbitmq-server#5460 has been closed and is targetting RabbitMQ server 3.11.5. I'll mark this issue as complete for now. Feel free to re-open if you encounter this issue in 3.11.5+ |
[Issue]
I have 2 single active consumers (A, B).
A first consumer was active, B second was ready.
then, i killed A first active consumer while other process publish 10000 messages.
I was expecting a transition from A to B for ACTIVE consumer.
but it isn't.
[Reproduce]
It is important that Active consumer does not receive all messages.
It should be killed in the middle of receiving messages.
As a result, I was expecting a transition from A to B , but it didn't.
All consumers are gone.
However, I found error logs of rabbitmq server.
It's too long, so I'm attaching it as a file.
rabbit-error-logs.txt
It doesn't seem to be a problem with amqp091-go.
The text was updated successfully, but these errors were encountered: