Repository navigation
[Java] Add the multiplexed stream JNI bridge - #1197
Draft
dimitrije-djordjevic-db wants to merge 1 commit into
Draft
dimitrije-djordjevic-db wants to merge 1 commit into
dimitrije-djordjevic-db wants to merge 1 commit into
Conversation
This was referenced Nov 23, 2026
dimitrije-djordjevic-db
force-pushed
the
effort/mux-streams-jni-shared-creation
branch
from
November 24, 2026 14:39
5e8ffb3 to
71827e2
Compare
dimitrije-djordjevic-db
force-pushed
the
effort/mux-streams-jni-bridge
branch
from
November 24, 2026 14:39
8312b14 to
4f53a47
Compare
Bridge the Rust multiplexed stream (Beta) to Java: native methods to create a multiplexed stream with OAuth, a headers provider or federated auth, ingest single records and batches, wait for message IDs, flush, close and recover unacknowledged batches, plus a multiplexed ACK callback that receives message IDs. BaseZerobusMultiplexedStream holds the native handle behind a read-write lock, so several threads can use one stream while close() waits for calls already inside native code. ZerobusMultiplexedProtoStream is the first typed stream on top of it. Nothing is reachable from the public builder yet; the next change adds the public API. New native methods, so the native ABI version goes to 4 and a stale libzerobus_jni is rejected at load. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: Dimitrije Đorđević <dimitrije.djordjevic@databricks.com>
dimitrije-djordjevic-db
force-pushed
the
effort/mux-streams-jni-shared-creation
branch
from
November 27, 2026 12:59
71827e2 to
eb3584d
Compare
dimitrije-djordjevic-db
force-pushed
the
effort/mux-streams-jni-bridge
branch
from
November 27, 2026 13:10
4f53a47 to
dc669b6
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.
Stack
What changes are proposed in this pull request?
Adds the JNI bridge for multiplexed streams (Beta). Nothing in this PR is reachable from the public builder yet; the next PR of this stack adds the public API.
multiplexed.rs: native methods to create a multiplexed stream with OAuth, a headers provider or federated auth, ingest single records and batches, wait for message IDs, flush, close and recover unacknowledged batches. A multiplexed ACK callback receives message IDs.BaseZerobusMultiplexedStreamholds the native handle behind a read/write lock. Several threads can use one stream, andclose()waits for calls that are already inside native code.ZerobusMultiplexedProtoStreamis the first typed stream on top of the base class.libzerobus_jniis rejected at load.NonRetriableException, not the retryableZerobusException.Why: the bridge, the thread-safe base and its native tests are the core of the feature. Reviewing them before the public API keeps each PR small.
Part of #1115.
Note: the open Java PRs #1098 (ABI 3) and #1103 (ABI 4) also bump the native ABI version. Whichever merges second renumbers.
How is this tested?
MultiplexedStreamNativeTestruns against the in-process mock server: create failures keep their retry class, protobuf records and message IDs cross the bridge in both directions, a server error reachesonErrorand keeps the record, a callback cannot block or stop delivery, threads share one stream, andclose()waits for a call inside native code.cargo test -p zerobus-jni: 16 passed; clippy and fmt clean.mvn test: 188 run, 0 failed, 32 skipped (env-gated integration tests); Javadoc clean.This pull request and its description were written by Isaac.