amqpcpp icon indicating copy to clipboard operation
amqpcpp copied to clipboard

How to reject or nack a message?

Open burningc opened this issue 9 years ago • 2 comments

A client gets a message from server and starts working.If it finishes the work,it can use AMQPQueue.Ack to notify the server.But how to send a fail message to notify the server to distribute the message to other client?

burningc avatar Dec 05 '15 06:12 burningc

Add this method in AMQPQueue :

void AMQPQueue::Reject(uint32_t delivery_tag, amqp_boolean_t requeue) {
    this->delivery_tag=delivery_tag;

    amqp_basic_reject_t_ s;
    s.delivery_tag = delivery_tag;
    s.requeue = requeue;

    amqp_send_method(*cnn, channelNum, AMQP_BASIC_REJECT_METHOD, &s);
}

dqueffeulouatw avatar Aug 31 '16 10:08 dqueffeulouatw

Ok, make pull request.

akalend avatar Sep 09 '16 07:09 akalend