-
Notifications
You must be signed in to change notification settings - Fork 144
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
NoAck not working as expected? #243
Comments
Hello @msnelling - thanks for reporting this! I believe that you might have misunderstood how Hope this helps! |
On a different note: when you say "I would simply like them to remain on the queue unacknowledged" do you mean that you want the client in which the exception occurred to keep the message unack'ed? If that's the case, then I would say it is a bit unconventional approach, as the message will be "processed" by the client forever. The only way to get the client to "release" the message would be to close the consumer's channel (by closing the channel, connection or simply restart the service). Perhaps you've already seen this, but there is a requeue with delay feature in RawRabbit. Not sure if it is close to what you want to do. |
Yes I can see how that sounds, the reason for not immediately Ack'ing the message is so that if for some reason the client crashes, or was running an older version of our protocol by mistake, the message isn't lost and is waiting in the queue for when the client restarts. We do Ack the message, but only after we have successfully processed it. |
Perfect! Well, I think you will get the desired behavior by removing the if (!config.NoAck)
{
// don't ack here, but put in in the list of acknowledged tags;
consumer.AcknowledgedTags.Add(args.DeliveryTag);
} |
Thanks! |
Hi,
I am using a subscriber with the following configuration
Posting a message to the queue using the RabbitMQ management website and it is throwing an exception on deserialization (this is expected in my case).
I'm using custom error handling to avoid faulty messages being published to the error exchange. I would simply like them to remain on the queue unacknowledged.
However, what I'm seeing is the message being Ack'd anyway and disappearing off the queue.
This is the OnSubscriberExceptionAsync function code in the custom error strategy.
In the debugger I can see that my custom strategy isn't performing the Ack.
The text was updated successfully, but these errors were encountered: