From 3a700226c8b18fff7c0f6dadc4b7885f9fe52c37 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Mon, 26 May 2014 18:17:49 +0200 Subject: [PATCH] BasicNack frame makes the consumer stop (dont know why) so we use the BackReject message instead when there is no need to reject multiple messages --- src/channelimpl.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/channelimpl.cpp b/src/channelimpl.cpp index 0b917f4e..0f6171d5 100644 --- a/src/channelimpl.cpp +++ b/src/channelimpl.cpp @@ -36,6 +36,7 @@ #include "basicackframe.h" #include "basicnackframe.h" #include "basicrecoverframe.h" +#include "basicrejectframe.h" /** * Set up namespace @@ -555,8 +556,17 @@ bool ChannelImpl::ack(uint64_t deliveryTag, int flags) */ bool ChannelImpl::reject(uint64_t deliveryTag, int flags) { - // send a nack frame - return send(BasicNackFrame(_id, deliveryTag, flags & multiple, flags & requeue)); + // should we reject multiple messages? + if (flags & multiple) + { + // send a nack frame + return send(BasicNackFrame(_id, deliveryTag, true, flags & requeue)); + } + else + { + // send a reject frame + return send(BasicRejectFrame(_id, deliveryTag, flags & requeue)); + } } /**