Package org.apache.pulsar.client.api.v5
package org.apache.pulsar.client.api.v5
Pulsar Client API v5.
This is a redesigned client API that provides a cleaner, more modern interface for interacting with Apache Pulsar. Key design principles:
- No partition concept -- topics are opaque; only per-key ordering is guaranteed when a key is specified.
- Streaming vs queuing split --
StreamConsumerprovides ordered consumption with cumulative acknowledgment, whileQueueConsumerprovides parallel unordered consumption with individual acknowledgment. - Managed subscriptions -- consumers use broker-managed position tracking with automatic redelivery and dead-letter support.
- Checkpoint consumer --
CheckpointConsumerprovides unmanaged consumption with consistentCheckpointsupport, designed for connector frameworks (Flink, Spark). - Modern Java -- uses
Duration,Optional,Instant, records, and method-reference-friendly naming. - Transactions are first-class citizens, integrated directly into the producer and consumer APIs.
Entry point: PulsarClient.builder().
-
ClassDescriptionAn opaque, serializable position vector representing a consistent point across all internal hash-range segments of a topic.An unmanaged consumer designed for connector frameworks (Flink, Spark, etc.).Builder for configuring and creating a
CheckpointConsumer.Message<T>An immutable message received from a Pulsar topic.Synchronous message builder, obtained fromProducer.newMessage().Opaque, immutable identifier for a message within a topic.MessageMetadata<T,BuilderT extends MessageMetadata<T, BuilderT>> Common message metadata that can be set on any outgoing message.Messages<T>A batch of messages received from a consumer.Producer<T>A producer publishes messages to a Pulsar topic.Builder for configuring and creating aProducer.Entry point for the Pulsar client.Builder for configuring and creating aPulsarClient.Base exception for all Pulsar client operations.A consumer for queue (unordered) consumption with broker-managed position tracking.Builder for configuring and creating aQueueConsumer.A consumer for streaming (ordered) consumption with broker-managed position tracking.Builder for configuring and creating aStreamConsumer.A Pulsar transaction handle.