Skip to content

Commit

Permalink
BasicNack frame makes the consumer stop (dont know why) so we use the…
Browse files Browse the repository at this point in the history
… BackReject message instead when there is no need to reject multiple messages
  • Loading branch information
EmielBruijntjes committed May 26, 2014
1 parent ca8a39e commit 3a70022
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/channelimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "basicackframe.h"
#include "basicnackframe.h"
#include "basicrecoverframe.h"
#include "basicrejectframe.h"

/**
* Set up namespace
Expand Down Expand Up @@ -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));
}
}

/**
Expand Down

0 comments on commit 3a70022

Please sign in to comment.