Uses of Interface
org.apache.pulsar.client.api.ConsumerBuilder
-
Uses of ConsumerBuilder in org.apache.pulsar.client.api
Modifier and TypeMethodDescriptionConsumerBuilder.acknowledgmentGroupTime
(long delay, TimeUnit unit) Sets amount of time for group consumer acknowledgments.ConsumerBuilder.ackTimeout
(long ackTimeout, TimeUnit timeUnit) Sets the timeout for unacknowledged messages, truncated to the nearest millisecond.ConsumerBuilder.ackTimeoutRedeliveryBackoff
(RedeliveryBackoff ackTimeoutRedeliveryBackoff) Sets the redelivery backoff policy for messages that are redelivered due to acknowledgement timeout.ConsumerBuilder.ackTimeoutTickTime
(long tickTime, TimeUnit timeUnit) Define the granularity of the ack-timeout redelivery.ConsumerBuilder.autoAckOldestChunkedMessageOnQueueFull
(boolean autoAckOldestChunkedMessageOnQueueFull) Buffering large number of outstanding uncompleted chunked messages can create memory pressure and it can be guarded by providing this @maxPendingChunkedMessage threshold.ConsumerBuilder.autoScaledReceiverQueueSizeEnabled
(boolean enabled) If this is enabled, the consumer receiver queue size is initialized as a very small value, 1 by default, and will double itself until it reaches the value set byreceiverQueueSize(int)
, if and only if:ConsumerBuilder.autoUpdatePartitions
(boolean autoUpdate) If enabled, the consumer auto-subscribes for partition increases.ConsumerBuilder.autoUpdatePartitionsInterval
(int interval, TimeUnit unit) Sets the interval of updating partitions (default: 1 minute).ConsumerBuilder.batchReceivePolicy
(BatchReceivePolicy batchReceivePolicy) SetsBatchReceivePolicy
for the consumer.TopicConsumerBuilder.build()
Complete the configuration of the topic specific options and return control back to theConsumerBuilder
instance.ConsumerBuilder.clone()
Create a copy of the current consumer builder.ConsumerBuilder.consumerEventListener
(ConsumerEventListener consumerEventListener) Sets aConsumerEventListener
for the consumer.ConsumerBuilder.consumerName
(String consumerName) Sets the consumer name.ConsumerBuilder.cryptoFailureAction
(ConsumerCryptoFailureAction action) Sets the ConsumerCryptoFailureAction to the value specified.ConsumerBuilder.cryptoKeyReader
(CryptoKeyReader cryptoKeyReader) Sets aCryptoKeyReader
.ConsumerBuilder.deadLetterPolicy
(DeadLetterPolicy deadLetterPolicy) Sets dead letter policy for a consumer.ConsumerBuilder.defaultCryptoKeyReader
(String privateKey) Sets the default implementation ofCryptoKeyReader
.ConsumerBuilder.defaultCryptoKeyReader
(Map<String, String> privateKeys) Sets the default implementation ofCryptoKeyReader
.ConsumerBuilder.enableBatchIndexAcknowledgment
(boolean batchIndexAcknowledgmentEnabled) Enable or disable batch index acknowledgment.ConsumerBuilder.enableRetry
(boolean retryEnable) If enabled, the consumer auto-retries messages.ConsumerBuilder.expireTimeOfIncompleteChunkedMessage
(long duration, TimeUnit unit) If the producer fails to publish all the chunks of a message, then the consumer can expire incomplete chunks if the consumer doesn't receive all chunks during the expiration period (default 1 minute).ConsumerBuilder.intercept
(ConsumerInterceptor<T>... interceptors) InterceptConsumer
.ConsumerBuilder.isAckReceiptEnabled
(boolean isAckReceiptEnabled) Enables or disables the acknowledgment receipt feature.ConsumerBuilder.keySharedPolicy
(KeySharedPolicy keySharedPolicy) Sets KeyShared subscription policy for consumer.Load the configuration from provided config map.ConsumerBuilder.maxAcknowledgmentGroupSize
(int messageNum) Set the number of messages for group consumer acknowledgments.ConsumerBuilder.maxPendingChuckedMessage
(int maxPendingChuckedMessage) Deprecated.ConsumerBuilder.maxPendingChunkedMessage
(int maxPendingChunkedMessage) Consumer buffers chunk messages into memory until it receives all the chunks of the original message.ConsumerBuilder.maxTotalReceiverQueueSizeAcrossPartitions
(int maxTotalReceiverQueueSizeAcrossPartitions) Sets the max total receiver queue size across partitions.ConsumerBuilder.messageCrypto
(MessageCrypto messageCrypto) Sets aMessageCrypto
.ConsumerBuilder.messageListener
(MessageListener<T> messageListener) Sets aMessageListener
for the consumer.ConsumerBuilder.messageListenerExecutor
(MessageListenerExecutor messageListenerExecutor) Set theMessageListenerExecutor
to be used for message listeners of current consumer.ConsumerBuilder.messagePayloadProcessor
(MessagePayloadProcessor payloadProcessor) If configured with a non-null value, the consumer uses the processor to process the payload, including decoding it to messages and triggering the listener.ConsumerBuilder.negativeAckRedeliveryBackoff
(RedeliveryBackoff negativeAckRedeliveryBackoff) negativeAckRedeliveryBackoff sets the redelivery backoff policy for messages that are negatively acknowledged using `consumer.negativeAcknowledge(Messageinvalid input: '<'?> message)` but not with `consumer.negativeAcknowledge(MessageId messageId)`.ConsumerBuilder.negativeAckRedeliveryDelay
(long redeliveryDelay, TimeUnit timeUnit) Sets the delay to wait before re-delivering messages that have failed to be processed.ConsumerBuilder
<byte[]> PulsarClient.newConsumer()
Create a consumer builder with no schema (Schema.BYTES
) for subscribing to one or more topics.<T> ConsumerBuilder
<T> PulsarClient.newConsumer
(Schema<T> schema) Create a consumer builder with a specific schema for subscribing on a specific topicConsumerBuilder.patternAutoDiscoveryPeriod
(int periodInMinutes) Sets topic's auto-discovery period when using a pattern for topic's consumer.ConsumerBuilder.patternAutoDiscoveryPeriod
(int interval, TimeUnit unit) Sets topic's auto-discovery period when using a pattern for topic's consumer.ConsumerBuilder.poolMessages
(boolean poolMessages) Enable pooling of messages and the underlying data buffers.ConsumerBuilder.priorityLevel
(int priorityLevel) Shared subscriptionConsumerBuilder.properties
(Map<String, String> properties) Add all the properties in the provided map to the consumer.Sets a name/value property with this consumer.ConsumerBuilder.readCompacted
(boolean readCompacted) If enabled, the consumer reads messages from the compacted topic rather than the full message topic backlog.ConsumerBuilder.receiverQueueSize
(int receiverQueueSize) Sets the size of the consumer receive queue.ConsumerBuilder.replicateSubscriptionState
(boolean replicateSubscriptionState) ConsumerBuilder.startMessageIdInclusive()
Sets the consumer to include the given position of any reset operation likeConsumer.seek(long)
orConsumer.seek(MessageId)
}.ConsumerBuilder.startPaused
(boolean paused) Starts the consumer in a paused state.ConsumerBuilder.subscriptionInitialPosition
(SubscriptionInitialPosition subscriptionInitialPosition) Sets theSubscriptionInitialPosition
for the consumer.ConsumerBuilder.subscriptionMode
(SubscriptionMode subscriptionMode) Selects the subscription mode to be used when subscribing to a topic.ConsumerBuilder.subscriptionName
(String subscriptionName) Specify the subscription name for this consumer.ConsumerBuilder.subscriptionProperties
(Map<String, String> subscriptionProperties) Specify the subscription properties for this subscription.ConsumerBuilder.subscriptionTopicsMode
(RegexSubscriptionMode regexSubscriptionMode) Determines which topics this consumer should be subscribed to - Persistent, Non-Persistent, or both.ConsumerBuilder.subscriptionType
(SubscriptionType subscriptionType) Select the subscription type to be used when subscribing to a topic.Specify the topics this consumer subscribes to.ConsumerBuilder.topicConfiguration
(String topicName, Consumer<TopicConsumerBuilder<T>> builderConsumer) Configure topic specific options to override those set at theConsumerBuilder
level.ConsumerBuilder.topicConfiguration
(Pattern topicsPattern, Consumer<TopicConsumerBuilder<T>> builderConsumer) Configure topic specific options to override those set at theConsumerBuilder
level.Specify a list of topics that this consumer subscribes to.ConsumerBuilder.topicsPattern
(String topicsPattern) Specify a pattern for topics(not contains the partition suffix) that this consumer subscribes to.ConsumerBuilder.topicsPattern
(Pattern topicsPattern) Specify a pattern for topics(not contains the partition suffix) that this consumer subscribes to.
maxPendingChunkedMessage(int)