[feat] PIP-466: Add V5 client API for scalable topics#25489
Merged
merlimat merged 11 commits intoapache:masterfrom Apr 20, 2026
Merged
[feat] PIP-466: Add V5 client API for scalable topics#25489merlimat merged 11 commits intoapache:masterfrom
merlimat merged 11 commits intoapache:masterfrom
Conversation
Introduce pulsar-client-api-v5 module with new consumer types for scalable topics: StreamConsumer, QueueConsumer, and CheckpointConsumer. Define Producer, Message, Schema, and PulsarClient interfaces with a clean API design. Includes authentication, crypto, batching/compression config types, and a ServiceLoader-based PulsarClientProvider SPI.
- Fix import ordering in Authentication, AuthenticationFactory, Schema - Rename BUILDER type parameter to BuilderT in MessageMetadata - Expand single-line exception constructors in PulsarClientException - Rename uppercase Schema factory methods to camelCase - Remove @hidden Javadoc tag from PulsarClientProvider - Fix missing braces and import issues in Examples.java
…bleTracing Move connection-level settings (connectionTimeout, connectionsPerBroker, enableTcpNoDelay, keepAliveInterval, connectionMaxIdleTime, ioThreads, callbackThreads, proxy) into a new ConnectionPolicy record with a builder. Remove enableTracing flag — the client creates an internal OpenTelemetry instance with metrics-only by default. Users who want tracing pass a custom OpenTelemetry instance configured with a TracerProvider.
lhotari
reviewed
Apr 20, 2026
Member
lhotari
left a comment
There was a problem hiding this comment.
I added a few review comments
lhotari
approved these changes
Apr 20, 2026
- Add CompletableFuture<Void> closeAsync() as the async counterpart of close(). - Add CompletableFuture<Transaction> newTransactionAsync() and make the sync newTransaction() throw PulsarClientException, matching the rest of the sync/async pairs in this API. Per-transaction timeout overrides aren't supported: the timeout lives on the client-wide TransactionPolicy configured via PulsarClientBuilder.transactionPolicy.
The broker reconnection backoff is a connection-level setting, so it belongs on ConnectionPolicy alongside connectionTimeout and the other connection knobs. Remove the top-level PulsarClientBuilder.connectionBackoff setter and add a corresponding method on ConnectionPolicy.Builder with an exponential (100ms → 60s) default.
The boxed Void return type didn't buy anything — callers just ignored the null. Switch to plain void, matching Transaction.commit() alongside.
GeneratedMessageV3 is the concrete base for classic Protobuf-generated Java classes, but Protobuf 4+ generates classes that extend Message directly via GeneratedMessage. Widening the type bound to Message lets the schema accept either generator style.
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.
Summary
Implementation of PIP-466: New Java Client API (V5) for scalable topic support.
pulsar-client-api-v5module with type-safe interfaces for scalable topicsProducer/ProducerBuilderwith key-based routing, flow control, and async variantsCheckpointsnapshots for stream processing frameworks (Flink, Beam)AsyncProducer,AsyncStreamConsumer,AsyncQueueConsumer,AsyncCheckpointConsumer) for non-blocking usageExamples.javaRelated PIPs:
Test plan