add contributions from #3995
diff --git a/foreign/cpp/include/iggy.hpp b/foreign/cpp/include/iggy.hpp index a02b38e..662fc40 100644 --- a/foreign/cpp/include/iggy.hpp +++ b/foreign/cpp/include/iggy.hpp
@@ -3256,18 +3256,6 @@ }; /** - * @brief Partition value that names no partition. - * - * Low-level polling of a consumer group with it reads one of the partitions - * assigned to the polling member, taking the next one on every call. A regular - * consumer reads partition 0, and so does `get_consumer_offset(...)`. - * `store_consumer_offset(...)` and `delete_consumer_offset(...)` reject it and - * need an explicit partition. High-level calls express the same omission with - * `std::nullopt`. - */ -inline constexpr std::uint32_t kAnyPartitionId{std::numeric_limits<std::uint32_t>::max()}; - -/** * @brief Selects the destination partition for a batch of messages. * * Balanced() distributes batches across the topic's partitions. PartitionId()
diff --git a/foreign/cpp/tests/e2e/client.cpp b/foreign/cpp/tests/e2e/client.cpp index 6f640a6..4f26cd1 100644 --- a/foreign/cpp/tests/e2e/client.cpp +++ b/foreign/cpp/tests/e2e/client.cpp
@@ -2924,7 +2924,7 @@ EXPECT_EQ(offset_b.StoredOffset(), 3u); } -TEST_F(E2E_Client, StoreConsumerOffsetRejectsAnyPartitionId) { +TEST_F(E2E_Client, StoreConsumerOffsetRejectsMissingPartitionId) { RecordProperty("description", "Storing an offset needs an explicit partition, unlike polling."); const std::string stream_name = GetRandomName(); auto client = GetLoggedInHighLevelClient(); @@ -2938,6 +2938,6 @@ const auto consumer = iggy::Consumer::Single(iggy::Identifier::String("offset-consumer")); ASSERT_THROW(client.StoreConsumerOffset(consumer, iggy::Identifier::Numeric(stream.Id()), - iggy::Identifier::Numeric(0), iggy::kAnyPartitionId, 1), + iggy::Identifier::Numeric(0), std::nullopt, 1), iggy::IggyException); }
diff --git a/foreign/cpp/tests/unit/consumer.cpp b/foreign/cpp/tests/unit/consumer.cpp index 19c50b2..aed201b 100644 --- a/foreign/cpp/tests/unit/consumer.cpp +++ b/foreign/cpp/tests/unit/consumer.cpp
@@ -18,7 +18,6 @@ */ #include <cstdint> -#include <limits> #include <string> #include <variant> @@ -69,7 +68,3 @@ EXPECT_THROW((void)iggy::Consumer::Single(iggy::Identifier::String(too_long_name)), iggy::IggyException); EXPECT_THROW((void)iggy::Consumer::Group(iggy::Identifier::String(too_long_name)), iggy::IggyException); } - -TEST(AnyPartitionIdTest, LeavesThePartitionToTheServer) { - EXPECT_EQ(iggy::kAnyPartitionId, std::numeric_limits<std::uint32_t>::max()); -}