user1178246
user1178246

Reputation: 11

Restoring a message to the queue

After using Dequeue() to my queue, I want to restore the retrieved message to the queue. Is this possible?

Upvotes: 0

Views: 127

Answers (1)

Steve Martin
Steve Martin

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

Related Questions