Repository navigation
[Java] Add multiplexed streams - #1195
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
branch
from
November 23, 2026 19:11
78eaf4b to
afc1393
Compare
dimitrije-djordjevic-db
changed the base branch from
main
to
effort/mux-streams-jni-bridge
November 23, 2026 19:22
dimitrije-djordjevic-db
force-pushed
the
effort/mux-streams-jni
branch
from
November 24, 2026 14:39
afc1393 to
9707bca
Compare
dimitrije-djordjevic-db
force-pushed
the
effort/mux-streams-jni-bridge
branch
from
November 24, 2026 14:39
8312b14 to
4f53a47
Compare
Expose multiplexed streams (Beta) for JSON and Protocol Buffers: multiplexed(streamCount) on the json() and compiledProto(...) sub-builders returns a MultiplexedStreamBuilder, which takes a multiplexed ACK callback and builds a ZerobusMultiplexedJsonStream or ZerobusMultiplexedProtoStream. A multiplexed stream spreads records round-robin across sub-streams to raise throughput when one stream is the bottleneck. Ingest methods return message IDs, and unlike other Java streams, multiplexed streams are thread-safe. Every auth mode of StreamBuilder works, federated auth included. The README, an example, the changelog and the Javadoc describe message IDs, failures, resource management and thread safety. 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-bridge
branch
from
November 27, 2026 13:10
4f53a47 to
dc669b6
Compare
dimitrije-djordjevic-db
force-pushed
the
effort/mux-streams-jni
branch
from
November 27, 2026 13:10
9707bca to
6097463
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?
Exposes multiplexed streams (Beta) for JSON and Protocol Buffers in the public Java API:
multiplexed(streamCount)on thejson()andcompiledProto(...)sub-builders returns aMultiplexedStreamBuilder. It takes a multiplexed ACK callback and builds aZerobusMultiplexedJsonStreamorZerobusMultiplexedProtoStream.longmessage IDs, and unlike other Java streams, multiplexed streams are thread-safe.StreamBuilderworks, federated auth included.NonRetriableException, so retry loops stop. The Javadoc and README say so.isClosed()after any exception: if it returns true, recover the unacknowledged records, close the stream and ingest them into a new one; if it returns false, only that call failed.flush()) andNEXT_CHANGELOG.mddescribe message IDs, failures, resource management and thread safety.Why: one stream can be the throughput bottleneck. The Rust core has had multiplexed streams since v2.10.0; this exposes them to Java.
Part of #1115.
Follow-up for ordinary streams: #1225
How is this tested?
StreamBuilderTestchecks thatmultiplexed(n)rejects an out-of-range stream count and an ordinary ACK callback, and that the build reaches the multiplexed native create, federated auth included.MultiplexedStreamNativeTestandFederatedTokenNativeTestadd JSON and federated-auth cases against the in-process mock server.IntegrationTestruns a multiplexed protobuf stream against a real Zerobus endpoint.mvn test: 195 run, 0 failed, 33 skipped (env-gated integration tests). The env-gated multiplexed protobuf case passed against a real Zerobus endpoint.This pull request and its description were written by Isaac.