| Package | Description |
|---|---|
| org.apache.pulsar.client.api |
Pulsar Client API.
|
| Modifier and Type | Method and Description |
|---|---|
ConsumerBuilder<T> |
ConsumerBuilder.acknowledgmentGroupTime(long delay,
TimeUnit unit)
Group the consumer acknowledgments for the specified time.
|
ConsumerBuilder<T> |
ConsumerBuilder.ackTimeout(long ackTimeout,
TimeUnit timeUnit)
Set the timeout for unacked messages, truncated to the nearest millisecond.
|
ConsumerBuilder<T> |
ConsumerBuilder.ackTimeoutTickTime(long tickTime,
TimeUnit timeUnit)
Define the granularity of the ack-timeout redelivery.
|
ConsumerBuilder<T> |
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<T> |
ConsumerBuilder.autoUpdatePartitions(boolean autoUpdate)
If enabled, the consumer will auto subscribe for partitions increasement.
|
ConsumerBuilder<T> |
ConsumerBuilder.autoUpdatePartitionsInterval(int interval,
TimeUnit unit)
Set the interval of updating partitions (default: 1 minute).
|
ConsumerBuilder<T> |
ConsumerBuilder.batchReceivePolicy(BatchReceivePolicy batchReceivePolicy)
Set batch receive policy
BatchReceivePolicy for consumer. |
ConsumerBuilder<T> |
ConsumerBuilder.clone()
Create a copy of the current consumer builder.
|
ConsumerBuilder<T> |
ConsumerBuilder.consumerEventListener(ConsumerEventListener consumerEventListener)
Sets a
ConsumerEventListener for the consumer. |
ConsumerBuilder<T> |
ConsumerBuilder.consumerName(String consumerName)
Set the consumer name.
|
ConsumerBuilder<T> |
ConsumerBuilder.cryptoFailureAction(ConsumerCryptoFailureAction action)
Sets the ConsumerCryptoFailureAction to the value specified.
|
ConsumerBuilder<T> |
ConsumerBuilder.cryptoKeyReader(CryptoKeyReader cryptoKeyReader)
Sets a
CryptoKeyReader. |
ConsumerBuilder<T> |
ConsumerBuilder.deadLetterPolicy(DeadLetterPolicy deadLetterPolicy)
Set dead letter policy for consumer.
|
ConsumerBuilder<T> |
ConsumerBuilder.defaultCryptoKeyReader(Map<String,String> privateKeys)
Sets the default implementation of
CryptoKeyReader. |
ConsumerBuilder<T> |
ConsumerBuilder.defaultCryptoKeyReader(String privateKey)
Sets the default implementation of
CryptoKeyReader. |
ConsumerBuilder<T> |
ConsumerBuilder.enableBatchIndexAcknowledgment(boolean batchIndexAcknowledgmentEnabled)
Enable or disable the batch index acknowledgment.
|
ConsumerBuilder<T> |
ConsumerBuilder.enableRetry(boolean retryEnable)
If enabled, the consumer will auto retry message.
|
ConsumerBuilder<T> |
ConsumerBuilder.expireTimeOfIncompleteChunkedMessage(long duration,
TimeUnit unit)
If producer fails to publish all the chunks of a message then consumer can expire incomplete chunks if consumer
won't be able to receive all chunks in expire times (default 1 hour).
|
ConsumerBuilder<T> |
ConsumerBuilder.intercept(ConsumerInterceptor<T>... interceptors)
Intercept
Consumer. |
ConsumerBuilder<T> |
ConsumerBuilder.isAckReceiptEnabled(boolean isAckReceiptEnabled)
Ack will return receipt but does not mean that the message will not be resent after get receipt.
|
ConsumerBuilder<T> |
ConsumerBuilder.keySharedPolicy(KeySharedPolicy keySharedPolicy)
Set KeyShared subscription policy for consumer.
|
ConsumerBuilder<T> |
ConsumerBuilder.loadConf(Map<String,Object> config)
Load the configuration from provided config map.
|
ConsumerBuilder<T> |
ConsumerBuilder.maxPendingChuckedMessage(int maxPendingChuckedMessage)
Deprecated.
|
ConsumerBuilder<T> |
ConsumerBuilder.maxPendingChunkedMessage(int maxPendingChunkedMessage)
Consumer buffers chunk messages into memory until it receives all the chunks of the original message.
|
ConsumerBuilder<T> |
ConsumerBuilder.maxTotalReceiverQueueSizeAcrossPartitions(int maxTotalReceiverQueueSizeAcrossPartitions)
Set the max total receiver queue size across partitons.
|
ConsumerBuilder<T> |
ConsumerBuilder.messageCrypto(MessageCrypto messageCrypto)
Sets a
MessageCrypto. |
ConsumerBuilder<T> |
ConsumerBuilder.messageListener(MessageListener<T> messageListener)
Sets a
MessageListener for the consumer |
ConsumerBuilder<T> |
ConsumerBuilder.negativeAckRedeliveryDelay(long redeliveryDelay,
TimeUnit timeUnit)
Set the delay to wait before re-delivering messages that have failed to be process.
|
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 topic
|
ConsumerBuilder<T> |
ConsumerBuilder.patternAutoDiscoveryPeriod(int periodInMinutes)
Set topics auto discovery period when using a pattern for topics consumer.
|
ConsumerBuilder<T> |
ConsumerBuilder.patternAutoDiscoveryPeriod(int interval,
TimeUnit unit)
Set topics auto discovery period when using a pattern for topics consumer.
|
ConsumerBuilder<T> |
ConsumerBuilder.poolMessages(boolean poolMessages)
Enable pooling of messages and the underlying data buffers.
|
ConsumerBuilder<T> |
ConsumerBuilder.priorityLevel(int priorityLevel)
Shared subscription
Sets priority level for the shared subscription consumers to which broker gives more priority while dispatching
messages.
|
ConsumerBuilder<T> |
ConsumerBuilder.properties(Map<String,String> properties)
Add all the properties in the provided map to the consumer.
|
ConsumerBuilder<T> |
ConsumerBuilder.property(String key,
String value)
Set a name/value property with this consumer.
|
ConsumerBuilder<T> |
ConsumerBuilder.readCompacted(boolean readCompacted)
If enabled, the consumer will read messages from the compacted topic rather than reading the full message backlog
of the topic.
|
ConsumerBuilder<T> |
ConsumerBuilder.receiverQueueSize(int receiverQueueSize)
Sets the size of the consumer receive queue.
|
ConsumerBuilder<T> |
ConsumerBuilder.replicateSubscriptionState(boolean replicateSubscriptionState) |
ConsumerBuilder<T> |
ConsumerBuilder.startMessageIdInclusive()
Set the consumer to include the given position of any reset operation like
or
{@link Consumer#seek(MessageId)}. |
ConsumerBuilder<T> |
ConsumerBuilder.subscriptionInitialPosition(SubscriptionInitialPosition subscriptionInitialPosition)
Set the
SubscriptionInitialPosition for the consumer. |
ConsumerBuilder<T> |
ConsumerBuilder.subscriptionMode(SubscriptionMode subscriptionMode)
Select the subscription mode to be used when subscribing to the topic.
|
ConsumerBuilder<T> |
ConsumerBuilder.subscriptionName(String subscriptionName)
Specify the subscription name for this consumer.
|
ConsumerBuilder<T> |
ConsumerBuilder.subscriptionTopicsMode(RegexSubscriptionMode regexSubscriptionMode)
Determines to which topics this consumer should be subscribed to - Persistent, Non-Persistent, or both.
|
ConsumerBuilder<T> |
ConsumerBuilder.subscriptionType(SubscriptionType subscriptionType)
Select the subscription type to be used when subscribing to the topic.
|
ConsumerBuilder<T> |
ConsumerBuilder.topic(String... topicNames)
Specify the topics this consumer will subscribe on.
|
ConsumerBuilder<T> |
ConsumerBuilder.topics(List<String> topicNames)
Specify a list of topics that this consumer will subscribe on.
|
ConsumerBuilder<T> |
ConsumerBuilder.topicsPattern(Pattern topicsPattern)
Specify a pattern for topics that this consumer will subscribe on.
|
ConsumerBuilder<T> |
ConsumerBuilder.topicsPattern(String topicsPattern)
Specify a pattern for topics that this consumer will subscribe on.
|
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.