Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/rmq/rmqt/rmqt_consumerack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@

#include <rmqt_envelope.h>

#include <bslmf_assert.h>

namespace BloombergLP {
namespace rmqt {

// Until REJECT and REQUEUE can be retired
BSLMF_ASSERT(ConsumerAck::REJECT == ConsumerAck::NACK_REQUEUE_FALSE);
BSLMF_ASSERT(ConsumerAck::REQUEUE == ConsumerAck::NACK_REQUEUE_TRUE);

ConsumerAck::ConsumerAck(const Envelope& envelope, Type type)
: d_envelope(envelope)
, d_type(type)
Expand Down
14 changes: 2 additions & 12 deletions src/rmq/rmqt/rmqt_consumerack.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,7 @@ class ConsumerAck {
/// `basic.reject` with requeue=false
REJECT_REQUEUE_FALSE = 3,
/// `basic.reject` with requeue=true
REJECT_REQUEUE_TRUE = 4,

/// \deprecated Use `NACK_REQUEUE_FALSE`. This name predates support
/// for `basic.reject` and is misleading: it sends
/// `basic.nack`, so the delivery is not counted as a
/// failed attempt.
REJECT = NACK_REQUEUE_FALSE,
/// \deprecated Use `NACK_REQUEUE_TRUE`. This name predates support
/// for `basic.reject`.
REQUEUE = NACK_REQUEUE_TRUE
REJECT_REQUEUE_TRUE = 4
};

ConsumerAck(const Envelope& envelope, Type type);
Expand All @@ -65,8 +56,7 @@ class ConsumerAck {
Type type() const { return d_type; }

/// RETURN `true` if `type` sends `basic.reject` rather than
/// `basic.nack`. Note this is `false` for the deprecated `REJECT`, which
/// sends `basic.nack`.
/// `basic.nack`.
static bool usesBasicReject(Type type);

/// RETURN `true` if the AMQP method that `type` sends carries a
Expand Down
27 changes: 0 additions & 27 deletions src/tests/rmqt/rmqt_consumerack.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,6 @@ bsl::string toString(rmqt::ConsumerAck::Type type)

} // namespace

// The values are the stable part of this enum: they go in no wire frame, but
// the deprecated aliases only remain compatible while they keep the value
// their old name had.
TEST(ConsumerAckTests, ValuesAreFixed)
{
EXPECT_EQ(rmqt::ConsumerAck::ACK, 0);
EXPECT_EQ(rmqt::ConsumerAck::NACK_REQUEUE_FALSE, 1);
EXPECT_EQ(rmqt::ConsumerAck::NACK_REQUEUE_TRUE, 2);
EXPECT_EQ(rmqt::ConsumerAck::REJECT_REQUEUE_FALSE, 3);
EXPECT_EQ(rmqt::ConsumerAck::REJECT_REQUEUE_TRUE, 4);
}

// REJECT and REQUEUE predate support for basic.reject and both send
// basic.nack. They have to keep meaning exactly what they meant before.
TEST(ConsumerAckTests, DeprecatedAliasesAreUnchanged)
{
EXPECT_EQ(rmqt::ConsumerAck::REJECT, rmqt::ConsumerAck::NACK_REQUEUE_FALSE);
EXPECT_EQ(rmqt::ConsumerAck::REQUEUE, rmqt::ConsumerAck::NACK_REQUEUE_TRUE);
}

TEST(ConsumerAckTests, UsesBasicReject)
{
EXPECT_FALSE(rmqt::ConsumerAck::usesBasicReject(rmqt::ConsumerAck::ACK));
Expand All @@ -70,13 +50,6 @@ TEST(ConsumerAckTests, UsesBasicReject)
rmqt::ConsumerAck::REJECT_REQUEUE_TRUE));
}

// The deprecated REJECT sends basic.nack, so it must not be reported as a
// basic.reject however much its name suggests otherwise.
TEST(ConsumerAckTests, DeprecatedRejectDoesNotUseBasicReject)
{
EXPECT_FALSE(rmqt::ConsumerAck::usesBasicReject(rmqt::ConsumerAck::REJECT));
}

// basic.ack and basic.nack carry a `multiple` flag, basic.reject does not.
// Batching a reject would resolve only the highest delivery tag in the batch
// and silently leave the rest outstanding.
Expand Down
Loading