[Rust] Add mux acknowledgment callback bridge#457
Merged
Conversation
Member
Author
|
@elenagaljak-db's comments from previous PR |
Member
Author
|
@elenagaljak-db this should be much cleaner now, we have the adapter/bridge to translate the message_id in mux streams to the offset id in individual streams and made the ack callback IDs generic (so we can reuse the same one for both mux and normal streams) |
teodordelibasic-db
approved these changes
Jul 14, 2026
| fn on_error(&self, id: Id, error_message: &str); | ||
| } | ||
|
|
||
| #[allow(dead_code)] |
Collaborator
There was a problem hiding this comment.
nit: I don't think this is needed.
Member
Author
There was a problem hiding this comment.
ill remove it anyway when I integrate this in the stream builder
Signed-off-by: danilo-najkov-db <danilo.najkov@databricks.com>
27eab9c to
ffaeabc
Compare
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.

What changes are proposed in this pull request?
This PR implements the acknowledgment callback bridge required by multiplexed streams.
AckCallbackover its identifier type while preservingOffsetIdas the default, so existing individual-stream callback implementations remain unchanged.OffsetIdinto theMessageIdexposed byMultiplexedStream.AckCallback<MessageId>.The multiplexed stream builder is being added separately in #433. Its only callback-specific responsibility will be to install one adapter per sub-stream:
This gives multiplexed streams the same user-facing callback API as individual streams, except the identifier is
MessageIdinstead ofOffsetId:Each adapter already knows which sub-stream it belongs to, so callback delivery requires no lookup, routing table, or locking. It only packs the captured stream index and acknowledged offset into a
MessageIdbefore invoking the user callback.How is this tested?
MessageIdvalues for the same stream-local offset.MessageIdand error message.cargo test -p databricks-zerobus-ingest-sdkcargo clippy -p databricks-zerobus-ingest-sdk --all-targets -- -D warningscargo fmt --all --check