feat(cpp): add functions related to offset, tests related to consumer groups#3559
feat(cpp): add functions related to offset, tests related to consumer groups#3559slbotbm wants to merge 11 commits into
Conversation
…ffset, delete_consumer_offset, flush_unsaved_buffer
|
Thanks for the PR. It is labeled Slash commands (own line, regular comment) move it around the queue:
See CONTRIBUTING.md for details. |
| println!("cargo:rerun-if-changed=src/client.rs"); | ||
| println!("cargo:rerun-if-changed=src/consumer_group.rs"); | ||
| println!("cargo:rerun-if-changed=src/consumer.rs"); | ||
| println!("cargo:rerun-if-changed=src/producer.rs"); |
There was a problem hiding this comment.
the rerun-if-changed list is out of sync with this PR. lines 29-30 still point at src/stream.rs and src/topic.rs, both deleted here. once a build script emits any rerun-if-changed, cargo stops watching the whole package and only watches the listed paths - and a listed path that no longer exists is treated as always-dirty, so the script reruns on every cargo build and recompiles the cxx C++ bridge each time. confirmed locally: with a missing listed path the build script ran on 3 of 3 no-op builds, vs 1 of 3 when every path exists. fix: drop the stream.rs and topic.rs lines. separately the new src/type_conversion.rs isn't listed - not a correctness issue (cxx codegen only reads lib.rs, and the crate recompiles on any .rs change regardless) but worth adding for consistency.
| }) | ||
| } | ||
|
|
||
| pub fn store_consumer_offset( |
There was a problem hiding this comment.
store_consumer_offset, get_consumer_offset and delete_consumer_offset repeat the same two blocks verbatim - the consumer_kind match ("consumer" -> Consumer::new, "consumer_group" -> Consumer::group, else error) and the partition_id == ANY_PARTITION_ID -> Option mapping (a 4th copy of the one in poll_messages). worth pulling out a small resolve_consumer(kind, id) helper plus an opt_partition(u32) helper so the kind strings and the sentinel live in one place. drops ~30 lines and removes the risk of the three copies drifting apart.
|
/ready |
Which issue does this PR address?
Closes #
Relates to #2100
Rationale
Additions of more functions and tests in the cpp sdk.
What changed?
Local Execution
AI Usage
If AI tools were used, please answer: