feat(cpp): let poll and offset calls take a typed consumer - #3995
Open
ethanlin01x wants to merge 7 commits into
Open
feat(cpp): let poll and offset calls take a typed consumer#3995ethanlin01x wants to merge 7 commits into
ethanlin01x wants to merge 7 commits into
Conversation
Frees the name for the consumer a poll names, matching the Rust SDK.
The kind was a string, so a bad one only failed once it reached Rust.
Building the bridge struct by hand leaves the kind unset and the partition sentinel unnamed.
The kind is now checked where the call is written. BREAKING CHANGE: poll_messages, store_consumer_offset, get_consumer_offset and delete_consumer_offset replace their consumer_kind and consumer_id arguments with a single consumer.
Two names read the whole partition, one shared name does not, and a group member reads its assignment rather than partition 0.
Clears the TODO left for them, now that consumer groups exist.
ethanlin01x
force-pushed
the
feat/cpp-typed-consumer
branch
from
August 30, 2026 08:26
9538c7a to
f7441df
Compare
ethanlin01x
marked this pull request as ready for review
August 30, 2026 08:28
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR address?
Relates to #3876
Rationale
The C++ SDK already let the caller name a consumer, but as a kind string paired with an identifier. Nothing checked that pair until it reached Rust, and the "let the server pick the partition" sentinel had no name at all.
What changed?
poll_messagesand the three consumer-offset calls tookconsumer_kind: String,consumer_id: Identifier. A typo such as "consumer_grp" compiled fine and failed at runtime, andConsumerKind::ConsumerGroupwas reachable only by spelling the kind correctly.They now take a single
Consumercarrying aConsumerKindenum, so the kind is checked where the call is written.iggy::Consumer::Single(id)andiggy::Consumer::Group(id)build it from either a name or a number, mirroring howTopicOptionbuilds its entries.iggy::kAnyPartitionIdgives theu32::MAXpartition sentinel a name and documents what each call does with it: a group poll reads one of the partitions assigned to the polling member, a regular poll and get_consumer_offset read partition 0, and the two offset writes reject it.The bridge already used the name Consumer for the placeholder wrapping the high-level consumer, so that one is renamed
IggyConsumer, matching the Rust SDK.Breaking change:
the four calls replace their
consumer_kindandconsumer_idarguments with a single consumer.Local Execution
AI Usage
If AI tools were used, please answer: