[rabbitmq-discuss] Re trieving a message to the queue
steve at rabbitmq.com
Tue Feb 21 18:16:21 GMT 2012
I have to make lots of assumptions here...
Assuming you are using the dot-net client, and the SharedQueue class (probably
behind a QueueingBasicConsumer), you have the ability to Enqueue(Object o) to
the SharedQueue, which puts it on the other end.
I wouldn't recommend it, though, since the QueueingBasicConsumer is Enqueueing
things there, too (in response to the Broker delivering messages), so you have
no control over what order the resulting queue is in.
In any case, the SharedQueue is entirely local to the client, and this action
doesn't involve RabbitMQ at all -- so the messages have no
delivery/ACK/NACK/order/persistence/redelivery guarantees at all. Plus, if you
try to ACK them twice (which you might the second time they reach the front of
the queue), you will get an error.
The way to resurrect a message in the RabbitMQ queue, is to NACK it with
requeue=true. RabbitMQ will then redeliver it. If you have already Acknowledged
it, you cannot get RabbitMQ to redeliver it and instead you need to re-publish the
message, or arrange for some other action to be taken.
If you choose to republish or simply get RabbitMQ to re-deliver be aware that
you should understand how this affects message-order in your application, and
have a strategy for preventing a 'slow-loop', whereby a so-called "poison
message" is requeued over and over again, indefinitely.
Steve Powell (a loopy bunny)
----------some more definitions from the SPD----------
vermin (v.) Treating the dachshund for roundworm.
chinchilla (n.) Cooling device for the lower jaw.
socialcast (n.) Someone to whom everyone is speaking but nobody likes.
On 20 Feb 2012, at 14:39, Bamboula wrote:
> After using Dequeue() to my queue, I want to restore the retrieved message to
> the queue. Is this possible?
> View this message in context: http://old.nabble.com/Retrieving-a-message-to-the-queue-tp33357047p33357047.html
> Sent from the RabbitMQ mailing list archive at Nabble.com.
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
More information about the rabbitmq-discuss