Reputation: 11
After using Dequeue() to my queue, I want to restore the retrieved message to the queue. Is this possible?
Upvotes: 0
Views: 127
Reputation: 1642
If you aren't auto acknowledging messages then it will get re-queued in the absence of an explicit acknowledgement. If you are auto acknowledging then you should just manually enqueue it.
So, if you are doing something like:
BasicDeliverEventArgs e = (BasicDeliverEventArgs)consumer.Queue.Dequeue();
then you can do something like:
consumer.Queue.Enqueue(e);
Is that the sort of thing you were after?
Upvotes: 1