[rabbitmq-discuss] rabbitmq-c use amqp_basic_ack(..., qwTag, ..) twice lead consumer lose

Alan Antonuk alan.antonuk at gmail.com
Mon Aug 19 16:42:33 BST 2013

>  , it's  seem OK. rabbitmq server reply NROMAL.
> I don't know librabbitmq that well, but basic.ack is an asynchronous
> method, so the server can't reply at all. The NORMAL "reply" is presumably
> being given to you unconditionally by the client library.
> The return value from amqp_basic_ack() indicates that the write to the
underlying socket was successful, it does not indicate that the call was
correct from the broker's point of view.

>  But  I  check  list_consumers. find
>> that  consumer  lose.  what's  the problem ?
> The consumer (and the channel) will have been closed. The server will have
> reported an error - I'm not sure how you get that in the C API.

The library will indicate a channel error occurred next time a function
that reads frames from the broker occurs. e.g., calling
amqp_simple_wait_frame() will return a AMQP_CHANNEL_CLOSE_METHOD on the
channel you did the invalid amqp_basic_ack().  Note that the broker will
only close the channel if an error occurs, it will not positively
acknowledge a correct basic.ack.

My recommendation is to add this to your applications processing loop -
when you go to read frames from the broker, check for channel.close methods
and take appropriate action.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130819/df37c290/attachment.htm>

More information about the rabbitmq-discuss mailing list