Class ImmutableReactiveMessageConsumerSpec
- java.lang.Object
-
- org.apache.pulsar.reactive.client.api.ImmutableReactiveMessageConsumerSpec
-
- All Implemented Interfaces:
ReactiveMessageConsumerSpec
public class ImmutableReactiveMessageConsumerSpec extends java.lang.Object implements ReactiveMessageConsumerSpec
Immutable spec for aReactiveMessageConsumer
.
-
-
Constructor Summary
Constructors Constructor Description ImmutableReactiveMessageConsumerSpec(java.util.List<java.lang.String> topicNames, java.util.regex.Pattern topicsPattern, org.apache.pulsar.client.api.RegexSubscriptionMode topicsPatternSubscriptionMode, java.time.Duration topicsPatternAutoDiscoveryPeriod, java.lang.String subscriptionName, org.apache.pulsar.client.api.SubscriptionMode subscriptionMode, org.apache.pulsar.client.api.SubscriptionType subscriptionType, org.apache.pulsar.client.api.SubscriptionInitialPosition subscriptionInitialPosition, org.apache.pulsar.client.api.KeySharedPolicy keySharedPolicy, java.lang.Boolean replicateSubscriptionState, java.util.Map<java.lang.String,java.lang.String> subscriptionProperties, java.lang.String consumerName, java.util.Map<java.lang.String,java.lang.String> properties, java.lang.Integer priorityLevel, java.lang.Boolean readCompacted, java.lang.Boolean batchIndexAckEnabled, java.time.Duration ackTimeout, java.time.Duration ackTimeoutTickTime, java.time.Duration acknowledgementsGroupTime, java.lang.Boolean acknowledgeAsynchronously, reactor.core.scheduler.Scheduler acknowledgeScheduler, java.time.Duration negativeAckRedeliveryDelay, org.apache.pulsar.client.api.DeadLetterPolicy deadLetterPolicy, java.lang.Boolean retryLetterTopicEnable, java.lang.Integer receiverQueueSize, java.lang.Integer maxTotalReceiverQueueSizeAcrossPartitions, java.lang.Boolean autoUpdatePartitions, java.time.Duration autoUpdatePartitionsInterval, org.apache.pulsar.client.api.CryptoKeyReader cryptoKeyReader, org.apache.pulsar.client.api.ConsumerCryptoFailureAction cryptoFailureAction, java.lang.Integer maxPendingChunkedMessage, java.lang.Boolean autoAckOldestChunkedMessageOnQueueFull, java.time.Duration expireTimeOfIncompleteChunkedMessage)
ImmutableReactiveMessageConsumerSpec(ReactiveMessageConsumerSpec consumerSpec)
Constructs a ImmutableReactiveMessageConsumerSpec from anotherReactiveMessageConsumerSpec
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Boolean
getAcknowledgeAsynchronously()
Gets whether to ignore the acknowledge operation completion and make it asynchronous from the message consuming processing to improve performance by allowing the acknowledges and message processing to interleave.java.time.Duration
getAcknowledgementsGroupTime()
Gets the duration used to group acknowledgements.reactor.core.scheduler.Scheduler
getAcknowledgeScheduler()
Gets the scheduler to use to handle acknowledgements.java.time.Duration
getAckTimeout()
Gets the timeout duration for unacknowledged messages.java.time.Duration
getAckTimeoutTickTime()
Gets the tick time of the ack-timeout redelivery.java.lang.Boolean
getAutoAckOldestChunkedMessageOnQueueFull()
Gets whether to automatically acknowledge pending chunked messages when maxPendingChunkedMessage is reached.java.lang.Boolean
getAutoUpdatePartitions()
Gets whether the consumer shall subscribe automatically to new partitions of partitioned topics.java.time.Duration
getAutoUpdatePartitionsInterval()
Gets the interval of updating partitions when autoUpdatePartitions is enabled.java.lang.Boolean
getBatchIndexAckEnabled()
Gets whether batch index acknowledgement is enabled.java.lang.String
getConsumerName()
Gets the consumer name.org.apache.pulsar.client.api.ConsumerCryptoFailureAction
getCryptoFailureAction()
Gets the action the consumer will take in case of decryption failures.org.apache.pulsar.client.api.CryptoKeyReader
getCryptoKeyReader()
Gets the key reader to be used to decrypt the message payloads.org.apache.pulsar.client.api.DeadLetterPolicy
getDeadLetterPolicy()
Gets the dead letter policy for the consumer.java.time.Duration
getExpireTimeOfIncompleteChunkedMessage()
Gets the time interval to expire incomplete chunks if a consumer fails to receive all the chunks.org.apache.pulsar.client.api.KeySharedPolicy
getKeySharedPolicy()
Gets the policy used forSubscriptionType.Key_Shared
subscriptions.java.lang.Integer
getMaxPendingChunkedMessage()
Gets the maximum number of messages in the queue holding pending chunked messages.java.lang.Integer
getMaxTotalReceiverQueueSizeAcrossPartitions()
Gets the max total receiver queue size across partitions.java.time.Duration
getNegativeAckRedeliveryDelay()
Gets the delay to wait before re-delivering messages that have failed to be processed.java.lang.Integer
getPriorityLevel()
Gets the priority level for the consumer to which a broker gives more priority while dispatching messages.java.util.Map<java.lang.String,java.lang.String>
getProperties()
Gets the consumer properties.java.lang.Boolean
getReadCompacted()
Gets whether to read messages from the compacted topic rather than reading the full message backlog of the topic.java.lang.Integer
getReceiverQueueSize()
Gets the size of the consumer receive queue.java.lang.Boolean
getReplicateSubscriptionState()
Gets whether the subscription shall be replicated.java.lang.Boolean
getRetryLetterTopicEnable()
Gets whether the retries are enabled.org.apache.pulsar.client.api.SubscriptionInitialPosition
getSubscriptionInitialPosition()
Gets the subscription initial position.org.apache.pulsar.client.api.SubscriptionMode
getSubscriptionMode()
Gets the subscription mode.java.lang.String
getSubscriptionName()
Gets the subscription name.java.util.Map<java.lang.String,java.lang.String>
getSubscriptionProperties()
Gets the properties for the subscription.org.apache.pulsar.client.api.SubscriptionType
getSubscriptionType()
Gets the subscription type.java.util.List<java.lang.String>
getTopicNames()
Gets the topics to subscribe to.java.util.regex.Pattern
getTopicsPattern()
Gets the topics pattern of the topics to subscribe to.java.time.Duration
getTopicsPatternAutoDiscoveryPeriod()
Gets the topics auto discovery period when using a topic pattern.org.apache.pulsar.client.api.RegexSubscriptionMode
getTopicsPatternSubscriptionMode()
Gets the type of topics to subscribe to when using a topic pattern - Persistent, Non-Persistent, or both.
-
-
-
Constructor Detail
-
ImmutableReactiveMessageConsumerSpec
public ImmutableReactiveMessageConsumerSpec(ReactiveMessageConsumerSpec consumerSpec)
Constructs a ImmutableReactiveMessageConsumerSpec from anotherReactiveMessageConsumerSpec
.- Parameters:
consumerSpec
- the spec to construct from
-
ImmutableReactiveMessageConsumerSpec
public ImmutableReactiveMessageConsumerSpec(java.util.List<java.lang.String> topicNames, java.util.regex.Pattern topicsPattern, org.apache.pulsar.client.api.RegexSubscriptionMode topicsPatternSubscriptionMode, java.time.Duration topicsPatternAutoDiscoveryPeriod, java.lang.String subscriptionName, org.apache.pulsar.client.api.SubscriptionMode subscriptionMode, org.apache.pulsar.client.api.SubscriptionType subscriptionType, org.apache.pulsar.client.api.SubscriptionInitialPosition subscriptionInitialPosition, org.apache.pulsar.client.api.KeySharedPolicy keySharedPolicy, java.lang.Boolean replicateSubscriptionState, java.util.Map<java.lang.String,java.lang.String> subscriptionProperties, java.lang.String consumerName, java.util.Map<java.lang.String,java.lang.String> properties, java.lang.Integer priorityLevel, java.lang.Boolean readCompacted, java.lang.Boolean batchIndexAckEnabled, java.time.Duration ackTimeout, java.time.Duration ackTimeoutTickTime, java.time.Duration acknowledgementsGroupTime, java.lang.Boolean acknowledgeAsynchronously, reactor.core.scheduler.Scheduler acknowledgeScheduler, java.time.Duration negativeAckRedeliveryDelay, org.apache.pulsar.client.api.DeadLetterPolicy deadLetterPolicy, java.lang.Boolean retryLetterTopicEnable, java.lang.Integer receiverQueueSize, java.lang.Integer maxTotalReceiverQueueSizeAcrossPartitions, java.lang.Boolean autoUpdatePartitions, java.time.Duration autoUpdatePartitionsInterval, org.apache.pulsar.client.api.CryptoKeyReader cryptoKeyReader, org.apache.pulsar.client.api.ConsumerCryptoFailureAction cryptoFailureAction, java.lang.Integer maxPendingChunkedMessage, java.lang.Boolean autoAckOldestChunkedMessageOnQueueFull, java.time.Duration expireTimeOfIncompleteChunkedMessage)
-
-
Method Detail
-
getTopicNames
public java.util.List<java.lang.String> getTopicNames()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the topics to subscribe to.- Specified by:
getTopicNames
in interfaceReactiveMessageConsumerSpec
- Returns:
- the topic names
- See Also:
ConsumerBuilder.topics(java.util.List<java.lang.String>)
-
getTopicsPattern
public java.util.regex.Pattern getTopicsPattern()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the topics pattern of the topics to subscribe to.- Specified by:
getTopicsPattern
in interfaceReactiveMessageConsumerSpec
- Returns:
- the topics pattern
- See Also:
ConsumerBuilder.topicsPattern(Pattern)
-
getTopicsPatternSubscriptionMode
public org.apache.pulsar.client.api.RegexSubscriptionMode getTopicsPatternSubscriptionMode()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the type of topics to subscribe to when using a topic pattern - Persistent, Non-Persistent, or both.- Specified by:
getTopicsPatternSubscriptionMode
in interfaceReactiveMessageConsumerSpec
- Returns:
- the pattern subscription mode
- See Also:
ConsumerBuilder.subscriptionTopicsMode(org.apache.pulsar.client.api.RegexSubscriptionMode)
-
getTopicsPatternAutoDiscoveryPeriod
public java.time.Duration getTopicsPatternAutoDiscoveryPeriod()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the topics auto discovery period when using a topic pattern.- Specified by:
getTopicsPatternAutoDiscoveryPeriod
in interfaceReactiveMessageConsumerSpec
- Returns:
- the topics discovery period
- See Also:
ConsumerBuilder.patternAutoDiscoveryPeriod(int)
-
getSubscriptionName
public java.lang.String getSubscriptionName()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the subscription name.- Specified by:
getSubscriptionName
in interfaceReactiveMessageConsumerSpec
- Returns:
- the name of the subscription
- See Also:
ConsumerBuilder.subscriptionName(java.lang.String)
-
getSubscriptionMode
public org.apache.pulsar.client.api.SubscriptionMode getSubscriptionMode()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the subscription mode.- Specified by:
getSubscriptionMode
in interfaceReactiveMessageConsumerSpec
- Returns:
- the subscription mode
- See Also:
ConsumerBuilder.subscriptionMode(org.apache.pulsar.client.api.SubscriptionMode)
-
getSubscriptionType
public org.apache.pulsar.client.api.SubscriptionType getSubscriptionType()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the subscription type.- Specified by:
getSubscriptionType
in interfaceReactiveMessageConsumerSpec
- Returns:
- the subscription type
- See Also:
ConsumerBuilder.subscriptionType(org.apache.pulsar.client.api.SubscriptionType)
-
getSubscriptionInitialPosition
public org.apache.pulsar.client.api.SubscriptionInitialPosition getSubscriptionInitialPosition()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the subscription initial position.- Specified by:
getSubscriptionInitialPosition
in interfaceReactiveMessageConsumerSpec
- Returns:
- the position where to initialize a newly created subscription
- See Also:
ConsumerBuilder.subscriptionInitialPosition(org.apache.pulsar.client.api.SubscriptionInitialPosition)
-
getKeySharedPolicy
public org.apache.pulsar.client.api.KeySharedPolicy getKeySharedPolicy()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the policy used forSubscriptionType.Key_Shared
subscriptions.- Specified by:
getKeySharedPolicy
in interfaceReactiveMessageConsumerSpec
- Returns:
- the key-shared policy
- See Also:
ConsumerBuilder.keySharedPolicy(org.apache.pulsar.client.api.KeySharedPolicy)
-
getReplicateSubscriptionState
public java.lang.Boolean getReplicateSubscriptionState()
Description copied from interface:ReactiveMessageConsumerSpec
Gets whether the subscription shall be replicated.- Specified by:
getReplicateSubscriptionState
in interfaceReactiveMessageConsumerSpec
- Returns:
- true if the subscription is replicated
- See Also:
ConsumerBuilder.replicateSubscriptionState(boolean)
-
getSubscriptionProperties
public java.util.Map<java.lang.String,java.lang.String> getSubscriptionProperties()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the properties for the subscription.- Specified by:
getSubscriptionProperties
in interfaceReactiveMessageConsumerSpec
- Returns:
- the subscription properties
- See Also:
ConsumerBuilder.subscriptionProperties(java.util.Map<java.lang.String, java.lang.String>)
-
getConsumerName
public java.lang.String getConsumerName()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the consumer name.- Specified by:
getConsumerName
in interfaceReactiveMessageConsumerSpec
- Returns:
- the consumer name
- See Also:
ConsumerBuilder.consumerName(java.lang.String)
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the consumer properties.- Specified by:
getProperties
in interfaceReactiveMessageConsumerSpec
- Returns:
- the consumer properties
- See Also:
ConsumerBuilder.properties(java.util.Map<java.lang.String, java.lang.String>)
-
getPriorityLevel
public java.lang.Integer getPriorityLevel()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the priority level for the consumer to which a broker gives more priority while dispatching messages.- Specified by:
getPriorityLevel
in interfaceReactiveMessageConsumerSpec
- Returns:
- the priority level of the consumer
- See Also:
ConsumerBuilder.priorityLevel(int)
-
getReadCompacted
public java.lang.Boolean getReadCompacted()
Description copied from interface:ReactiveMessageConsumerSpec
Gets whether to read messages from the compacted topic rather than reading the full message backlog of the topic.- Specified by:
getReadCompacted
in interfaceReactiveMessageConsumerSpec
- Returns:
- true if messages are read from the compacted topic
- See Also:
ConsumerBuilder.readCompacted(boolean)
-
getBatchIndexAckEnabled
public java.lang.Boolean getBatchIndexAckEnabled()
Description copied from interface:ReactiveMessageConsumerSpec
Gets whether batch index acknowledgement is enabled.- Specified by:
getBatchIndexAckEnabled
in interfaceReactiveMessageConsumerSpec
- Returns:
- true if batch index acknowledgement is enabled
- See Also:
ConsumerBuilder.enableBatchIndexAcknowledgment(boolean)
-
getAckTimeout
public java.time.Duration getAckTimeout()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the timeout duration for unacknowledged messages.- Specified by:
getAckTimeout
in interfaceReactiveMessageConsumerSpec
- Returns:
- the timeout duration for unacknowledged messages
- See Also:
ConsumerBuilder.ackTimeout(long, java.util.concurrent.TimeUnit)
-
getAckTimeoutTickTime
public java.time.Duration getAckTimeoutTickTime()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the tick time of the ack-timeout redelivery.- Specified by:
getAckTimeoutTickTime
in interfaceReactiveMessageConsumerSpec
- Returns:
- the tick time of the ack-timeout redelivery
- See Also:
ConsumerBuilder.ackTimeoutTickTime(long, java.util.concurrent.TimeUnit)
-
getAcknowledgementsGroupTime
public java.time.Duration getAcknowledgementsGroupTime()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the duration used to group acknowledgements.- Specified by:
getAcknowledgementsGroupTime
in interfaceReactiveMessageConsumerSpec
- Returns:
- the duration used to group acknowledgements
- See Also:
ConsumerBuilder.acknowledgmentGroupTime(long, java.util.concurrent.TimeUnit)
-
getAcknowledgeAsynchronously
public java.lang.Boolean getAcknowledgeAsynchronously()
Description copied from interface:ReactiveMessageConsumerSpec
Gets whether to ignore the acknowledge operation completion and make it asynchronous from the message consuming processing to improve performance by allowing the acknowledges and message processing to interleave.- Specified by:
getAcknowledgeAsynchronously
in interfaceReactiveMessageConsumerSpec
- Returns:
- true if the acknowledge operation completion is ignored
-
getAcknowledgeScheduler
public reactor.core.scheduler.Scheduler getAcknowledgeScheduler()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the scheduler to use to handle acknowledgements.- Specified by:
getAcknowledgeScheduler
in interfaceReactiveMessageConsumerSpec
- Returns:
- the scheduler to use to handle acknowledgements
-
getNegativeAckRedeliveryDelay
public java.time.Duration getNegativeAckRedeliveryDelay()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the delay to wait before re-delivering messages that have failed to be processed.- Specified by:
getNegativeAckRedeliveryDelay
in interfaceReactiveMessageConsumerSpec
- Returns:
- the redelivery delay for failed messages
- See Also:
ConsumerBuilder.negativeAckRedeliveryDelay(long, java.util.concurrent.TimeUnit)
-
getDeadLetterPolicy
public org.apache.pulsar.client.api.DeadLetterPolicy getDeadLetterPolicy()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the dead letter policy for the consumer.- Specified by:
getDeadLetterPolicy
in interfaceReactiveMessageConsumerSpec
- Returns:
- the dead letter policy
- See Also:
ConsumerBuilder.deadLetterPolicy(org.apache.pulsar.client.api.DeadLetterPolicy)
-
getRetryLetterTopicEnable
public java.lang.Boolean getRetryLetterTopicEnable()
Description copied from interface:ReactiveMessageConsumerSpec
Gets whether the retries are enabled.- Specified by:
getRetryLetterTopicEnable
in interfaceReactiveMessageConsumerSpec
- Returns:
- true if retries are enabled
- See Also:
ConsumerBuilder.enableRetry(boolean)
-
getReceiverQueueSize
public java.lang.Integer getReceiverQueueSize()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the size of the consumer receive queue.- Specified by:
getReceiverQueueSize
in interfaceReactiveMessageConsumerSpec
- Returns:
- the size of the consumer receive queue
- See Also:
ConsumerBuilder.receiverQueueSize(int)
-
getMaxTotalReceiverQueueSizeAcrossPartitions
public java.lang.Integer getMaxTotalReceiverQueueSizeAcrossPartitions()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the max total receiver queue size across partitions.- Specified by:
getMaxTotalReceiverQueueSizeAcrossPartitions
in interfaceReactiveMessageConsumerSpec
- Returns:
- the max total receiver queue size across partitions
- See Also:
ConsumerBuilder.maxTotalReceiverQueueSizeAcrossPartitions(int)
-
getAutoUpdatePartitions
public java.lang.Boolean getAutoUpdatePartitions()
Description copied from interface:ReactiveMessageConsumerSpec
Gets whether the consumer shall subscribe automatically to new partitions of partitioned topics.- Specified by:
getAutoUpdatePartitions
in interfaceReactiveMessageConsumerSpec
- Returns:
- true if the consumer subscribes automatically to new partitions
- See Also:
ConsumerBuilder.autoUpdatePartitions(boolean)
-
getAutoUpdatePartitionsInterval
public java.time.Duration getAutoUpdatePartitionsInterval()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the interval of updating partitions when autoUpdatePartitions is enabled.- Specified by:
getAutoUpdatePartitionsInterval
in interfaceReactiveMessageConsumerSpec
- Returns:
- the interval between partitions updates
- See Also:
ConsumerBuilder.autoUpdatePartitionsInterval(int, java.util.concurrent.TimeUnit)
,ConsumerBuilder.autoUpdatePartitions(boolean)
-
getCryptoKeyReader
public org.apache.pulsar.client.api.CryptoKeyReader getCryptoKeyReader()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the key reader to be used to decrypt the message payloads.- Specified by:
getCryptoKeyReader
in interfaceReactiveMessageConsumerSpec
- Returns:
- the key reader to be used to decrypt the message payloads
- See Also:
ConsumerBuilder.cryptoKeyReader(org.apache.pulsar.client.api.CryptoKeyReader)
-
getCryptoFailureAction
public org.apache.pulsar.client.api.ConsumerCryptoFailureAction getCryptoFailureAction()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the action the consumer will take in case of decryption failures.- Specified by:
getCryptoFailureAction
in interfaceReactiveMessageConsumerSpec
- Returns:
- the action the consumer will take in case of decryption failures
- See Also:
ConsumerBuilder.cryptoFailureAction(org.apache.pulsar.client.api.ConsumerCryptoFailureAction)
-
getMaxPendingChunkedMessage
public java.lang.Integer getMaxPendingChunkedMessage()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the maximum number of messages in the queue holding pending chunked messages.- Specified by:
getMaxPendingChunkedMessage
in interfaceReactiveMessageConsumerSpec
- Returns:
- the maximum number of messages in the queue holding pending chunked
- See Also:
messages.
-
getAutoAckOldestChunkedMessageOnQueueFull
public java.lang.Boolean getAutoAckOldestChunkedMessageOnQueueFull()
Description copied from interface:ReactiveMessageConsumerSpec
Gets whether to automatically acknowledge pending chunked messages when maxPendingChunkedMessage is reached.- Specified by:
getAutoAckOldestChunkedMessageOnQueueFull
in interfaceReactiveMessageConsumerSpec
- Returns:
- true to acknowledge the messages, false to have them redelivered.
- See Also:
ConsumerBuilder.autoAckOldestChunkedMessageOnQueueFull(boolean)
,ConsumerBuilder.maxPendingChunkedMessage(int)
-
getExpireTimeOfIncompleteChunkedMessage
public java.time.Duration getExpireTimeOfIncompleteChunkedMessage()
Description copied from interface:ReactiveMessageConsumerSpec
Gets the time interval to expire incomplete chunks if a consumer fails to receive all the chunks.- Specified by:
getExpireTimeOfIncompleteChunkedMessage
in interfaceReactiveMessageConsumerSpec
- Returns:
- the time interval to expire incomplete chunks.
- See Also:
ConsumerBuilder.expireTimeOfIncompleteChunkedMessage(long, java.util.concurrent.TimeUnit)
-
-