[rabbitmq-discuss] Basic Nack not working

Simon MacMullen simon at rabbitmq.com
Tue Jan 21 16:26:14 GMT 2014


This could be happening:

* You nack the message with requeue=true
* The message goes back in the queue
* The message is immediately redelivered to your consumer again

If there are no other consumers and no other messages, that could happen.

Cheers, Simon

On 21/01/14 13:50, Guillaume Ouellet wrote:
> Hi guys,
>
> Here is a reference to my stackoverflow post. Basically I'm wondering if
> I'm using nack as intented or not.
>
> http://stackoverflow.com/questions/21244281/basic-nack-not-being-processed
>
> ere is what I am trying to do:
>
>  1. Dequeue a message
>  2. Do an action with the message
>  3. If the action fails, put the message back in the queue
>  4. If the action succeeds, acknowldge the message
>
> My problem right now is that, if the action fails, the message isn't
> requeued, but stays unacknowledged. If I go in RabbitMQ web
> congifuration interface, I see that the messages are flagged as
> unacknowledged, even tho, the basic.Nack has been stepped over.
>
> |var  delivery=  subscription.Next();
>
> var  messageBody=  delivery.Body;
>
> try
> {
>     action.Invoke(messageBody);
>     subscription.Ack(delivery);
> }
> catch  (Exception  ex)
> {
>     subscription.Model..BasicNack(delivery.DeliveryTag,  false,  true);
>     throw  ex;
> }|
>
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>


-- 
Simon MacMullen
RabbitMQ, Pivotal


More information about the rabbitmq-discuss mailing list