Class ImmutableReactiveMessageConsumerSpec

java.lang.Object
org.apache.pulsar.reactive.client.api.ImmutableReactiveMessageConsumerSpec
All Implemented Interfaces:
ReactiveMessageConsumerSpec

public class ImmutableReactiveMessageConsumerSpec extends Object implements ReactiveMessageConsumerSpec
Immutable spec for a ReactiveMessageConsumer.
  • Constructor Details

    • ImmutableReactiveMessageConsumerSpec

      public ImmutableReactiveMessageConsumerSpec(ReactiveMessageConsumerSpec consumerSpec)
      Constructs a ImmutableReactiveMessageConsumerSpec from another ReactiveMessageConsumerSpec.
      Parameters:
      consumerSpec - the spec to construct from
    • ImmutableReactiveMessageConsumerSpec

      @Deprecated public ImmutableReactiveMessageConsumerSpec(List<String> topicNames, Pattern topicsPattern, org.apache.pulsar.client.api.RegexSubscriptionMode topicsPatternSubscriptionMode, Duration topicsPatternAutoDiscoveryPeriod, 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, Boolean replicateSubscriptionState, Map<String,String> subscriptionProperties, String consumerName, Map<String,String> properties, Integer priorityLevel, Boolean readCompacted, Boolean batchIndexAckEnabled, Duration ackTimeout, Duration ackTimeoutTickTime, Duration acknowledgementsGroupTime, Boolean acknowledgeAsynchronously, reactor.core.scheduler.Scheduler acknowledgeScheduler, Duration negativeAckRedeliveryDelay, org.apache.pulsar.client.api.DeadLetterPolicy deadLetterPolicy, Boolean retryLetterTopicEnable, Integer receiverQueueSize, Integer maxTotalReceiverQueueSizeAcrossPartitions, Boolean autoUpdatePartitions, Duration autoUpdatePartitionsInterval, org.apache.pulsar.client.api.CryptoKeyReader cryptoKeyReader, org.apache.pulsar.client.api.ConsumerCryptoFailureAction cryptoFailureAction, Integer maxPendingChunkedMessage, Boolean autoAckOldestChunkedMessageOnQueueFull, Duration expireTimeOfIncompleteChunkedMessage)
      Deprecated.
      since 0.7.0 for removal in 0.9.0 in favor of ImmutableReactiveMessageConsumerSpec(List, Pattern, RegexSubscriptionMode, Duration, String, SubscriptionMode, SubscriptionType, SubscriptionInitialPosition, KeySharedPolicy, Boolean, Map, String, Map, Integer, Boolean, Boolean, Duration, Duration, Duration, Boolean, Scheduler, Duration, RedeliveryBackoff, RedeliveryBackoff, DeadLetterPolicy, Boolean, Integer, Integer, Boolean, Duration, CryptoKeyReader, ConsumerCryptoFailureAction, Integer, Boolean, Duration)
      Constructs an instance with the specified parameters.
      Parameters:
      topicNames - the topics to subscribe to
      topicsPattern - the topics pattern of the topics to subscribe to
      topicsPatternSubscriptionMode - the type of topics to subscribe to when using a topic pattern - Persistent, Non-Persistent, or both
      topicsPatternAutoDiscoveryPeriod - the topics auto discovery period when using a topic pattern
      subscriptionName - the subscription name
      subscriptionMode - the subscription mode
      subscriptionType - the subscription type
      subscriptionInitialPosition - the subscription initial position
      keySharedPolicy - the policy used for SubscriptionType.Key_Shared subscriptions
      replicateSubscriptionState - whether the subscription shall be replicated
      subscriptionProperties - the properties for the subscription
      consumerName - the consumer name
      properties - the consumer properties
      priorityLevel - the priority level for the consumer to which a broker gives more priority while dispatching messages
      readCompacted - whether to read messages from the compacted topic rather than reading the full message backlog of the topic
      batchIndexAckEnabled - whether batch index acknowledgement is enabled
      ackTimeout - the timeout duration for unacknowledged messages
      ackTimeoutTickTime - the tick time of the ack-timeout redelivery
      acknowledgementsGroupTime - the duration used to group acknowledgements
      acknowledgeAsynchronously - 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
      acknowledgeScheduler - the scheduler to use to handle acknowledgements
      negativeAckRedeliveryDelay - the delay to wait before re-delivering messages that have failed to be processed
      deadLetterPolicy - the dead letter policy for the consumer
      retryLetterTopicEnable - whether the retries are enabled
      receiverQueueSize - the size of the consumer receive queue
      maxTotalReceiverQueueSizeAcrossPartitions - the maximum total receiver queue size across partitions
      autoUpdatePartitions - whether the consumer shall subscribe automatically to new partitions of partitioned topics
      autoUpdatePartitionsInterval - the interval of updating partitions when autoUpdatePartitions is enabled
      cryptoKeyReader - the key reader to be used to decrypt the message payloads
      cryptoFailureAction - the action the consumer will take in case of decryption failures
      maxPendingChunkedMessage - the maximum number of messages in the queue holding pending chunked messages
      autoAckOldestChunkedMessageOnQueueFull - whether to automatically acknowledge pending chunked messages when maxPendingChunkedMessage is reached
      expireTimeOfIncompleteChunkedMessage - the time interval to expire incomplete chunks if a consumer fails to receive all the chunks
  • Method Details

    • getTopicNames

      public List<String> getTopicNames()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets the topics to subscribe to.
      Specified by:
      getTopicNames in interface ReactiveMessageConsumerSpec
      Returns:
      the topic names
      See Also:
      • ConsumerBuilder.topics(java.util.List<java.lang.String>)
    • getTopicsPattern

      public Pattern getTopicsPattern()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets the topics pattern of the topics to subscribe to.
      Specified by:
      getTopicsPattern in interface ReactiveMessageConsumerSpec
      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 interface ReactiveMessageConsumerSpec
      Returns:
      the pattern subscription mode
      See Also:
      • ConsumerBuilder.subscriptionTopicsMode(org.apache.pulsar.client.api.RegexSubscriptionMode)
    • getTopicsPatternAutoDiscoveryPeriod

      public Duration getTopicsPatternAutoDiscoveryPeriod()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets the topics auto discovery period when using a topic pattern.
      Specified by:
      getTopicsPatternAutoDiscoveryPeriod in interface ReactiveMessageConsumerSpec
      Returns:
      the topics discovery period
      See Also:
      • ConsumerBuilder.patternAutoDiscoveryPeriod(int)
    • getSubscriptionName

      public String getSubscriptionName()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets the subscription name.
      Specified by:
      getSubscriptionName in interface ReactiveMessageConsumerSpec
      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 interface ReactiveMessageConsumerSpec
      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 interface ReactiveMessageConsumerSpec
      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 interface ReactiveMessageConsumerSpec
      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 for SubscriptionType.Key_Shared subscriptions.
      Specified by:
      getKeySharedPolicy in interface ReactiveMessageConsumerSpec
      Returns:
      the key-shared policy
      See Also:
      • ConsumerBuilder.keySharedPolicy(org.apache.pulsar.client.api.KeySharedPolicy)
    • getReplicateSubscriptionState

      public Boolean getReplicateSubscriptionState()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets whether the subscription shall be replicated.
      Specified by:
      getReplicateSubscriptionState in interface ReactiveMessageConsumerSpec
      Returns:
      true if the subscription is replicated
      See Also:
      • ConsumerBuilder.replicateSubscriptionState(boolean)
    • getSubscriptionProperties

      public Map<String,String> getSubscriptionProperties()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets the properties for the subscription.
      Specified by:
      getSubscriptionProperties in interface ReactiveMessageConsumerSpec
      Returns:
      the subscription properties
      See Also:
      • ConsumerBuilder.subscriptionProperties(java.util.Map<java.lang.String, java.lang.String>)
    • getConsumerName

      public String getConsumerName()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets the consumer name.
      Specified by:
      getConsumerName in interface ReactiveMessageConsumerSpec
      Returns:
      the consumer name
      See Also:
      • ConsumerBuilder.consumerName(java.lang.String)
    • getProperties

      public Map<String,String> getProperties()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets the consumer properties.
      Specified by:
      getProperties in interface ReactiveMessageConsumerSpec
      Returns:
      the consumer properties
      See Also:
      • ConsumerBuilder.properties(java.util.Map<java.lang.String, java.lang.String>)
    • getPriorityLevel

      public 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 interface ReactiveMessageConsumerSpec
      Returns:
      the priority level of the consumer
      See Also:
      • ConsumerBuilder.priorityLevel(int)
    • getReadCompacted

      public 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 interface ReactiveMessageConsumerSpec
      Returns:
      true if messages are read from the compacted topic
      See Also:
      • ConsumerBuilder.readCompacted(boolean)
    • getBatchIndexAckEnabled

      public Boolean getBatchIndexAckEnabled()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets whether batch index acknowledgement is enabled.
      Specified by:
      getBatchIndexAckEnabled in interface ReactiveMessageConsumerSpec
      Returns:
      true if batch index acknowledgement is enabled
      See Also:
      • ConsumerBuilder.enableBatchIndexAcknowledgment(boolean)
    • getAckTimeout

      public Duration getAckTimeout()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets the timeout duration for unacknowledged messages.
      Specified by:
      getAckTimeout in interface ReactiveMessageConsumerSpec
      Returns:
      the timeout duration for unacknowledged messages
      See Also:
      • ConsumerBuilder.ackTimeout(long, java.util.concurrent.TimeUnit)
    • getAckTimeoutTickTime

      public Duration getAckTimeoutTickTime()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets the tick time of the ack-timeout redelivery.
      Specified by:
      getAckTimeoutTickTime in interface ReactiveMessageConsumerSpec
      Returns:
      the tick time of the ack-timeout redelivery
      See Also:
      • ConsumerBuilder.ackTimeoutTickTime(long, java.util.concurrent.TimeUnit)
    • getAcknowledgementsGroupTime

      public Duration getAcknowledgementsGroupTime()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets the duration used to group acknowledgements.
      Specified by:
      getAcknowledgementsGroupTime in interface ReactiveMessageConsumerSpec
      Returns:
      the duration used to group acknowledgements
      See Also:
      • ConsumerBuilder.acknowledgmentGroupTime(long, java.util.concurrent.TimeUnit)
    • getAcknowledgeAsynchronously

      public 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 interface ReactiveMessageConsumerSpec
      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 interface ReactiveMessageConsumerSpec
      Returns:
      the scheduler to use to handle acknowledgements
    • getNegativeAckRedeliveryDelay

      public 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 interface ReactiveMessageConsumerSpec
      Returns:
      the redelivery delay for failed messages
      See Also:
      • ConsumerBuilder.negativeAckRedeliveryDelay(long, java.util.concurrent.TimeUnit)
    • getNegativeAckRedeliveryBackoff

      public org.apache.pulsar.client.api.RedeliveryBackoff getNegativeAckRedeliveryBackoff()
      Description copied from interface: ReactiveMessageConsumerSpec
      Get the negative ack redelivery backoff policy for messages that are negatively acknowledged.
      Specified by:
      getNegativeAckRedeliveryBackoff in interface ReactiveMessageConsumerSpec
      Returns:
      redeliveryBackoff
      See Also:
      • ConsumerBuilder.negativeAckRedeliveryBackoff(org.apache.pulsar.client.api.RedeliveryBackoff)
    • getAckTimeoutRedeliveryBackoff

      public org.apache.pulsar.client.api.RedeliveryBackoff getAckTimeoutRedeliveryBackoff()
      Description copied from interface: ReactiveMessageConsumerSpec
      Get the redelivery backoff policy for messages that are redelivered due to acknowledgement timeout.
      Specified by:
      getAckTimeoutRedeliveryBackoff in interface ReactiveMessageConsumerSpec
      Returns:
      redeliveryBackoff
      See Also:
      • ConsumerBuilder.ackTimeoutRedeliveryBackoff(org.apache.pulsar.client.api.RedeliveryBackoff)
    • 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 interface ReactiveMessageConsumerSpec
      Returns:
      the dead letter policy
      See Also:
      • ConsumerBuilder.deadLetterPolicy(org.apache.pulsar.client.api.DeadLetterPolicy)
    • getRetryLetterTopicEnable

      public Boolean getRetryLetterTopicEnable()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets whether the retries are enabled.
      Specified by:
      getRetryLetterTopicEnable in interface ReactiveMessageConsumerSpec
      Returns:
      true if retries are enabled
      See Also:
      • ConsumerBuilder.enableRetry(boolean)
    • getReceiverQueueSize

      public Integer getReceiverQueueSize()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets the size of the consumer receive queue.
      Specified by:
      getReceiverQueueSize in interface ReactiveMessageConsumerSpec
      Returns:
      the size of the consumer receive queue
      See Also:
      • ConsumerBuilder.receiverQueueSize(int)
    • getMaxTotalReceiverQueueSizeAcrossPartitions

      public Integer getMaxTotalReceiverQueueSizeAcrossPartitions()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets the max total receiver queue size across partitions.
      Specified by:
      getMaxTotalReceiverQueueSizeAcrossPartitions in interface ReactiveMessageConsumerSpec
      Returns:
      the max total receiver queue size across partitions
      See Also:
      • ConsumerBuilder.maxTotalReceiverQueueSizeAcrossPartitions(int)
    • getAutoUpdatePartitions

      public Boolean getAutoUpdatePartitions()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets whether the consumer shall subscribe automatically to new partitions of partitioned topics.
      Specified by:
      getAutoUpdatePartitions in interface ReactiveMessageConsumerSpec
      Returns:
      true if the consumer subscribes automatically to new partitions
      See Also:
      • ConsumerBuilder.autoUpdatePartitions(boolean)
    • getAutoUpdatePartitionsInterval

      public Duration getAutoUpdatePartitionsInterval()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets the interval of updating partitions when autoUpdatePartitions is enabled.
      Specified by:
      getAutoUpdatePartitionsInterval in interface ReactiveMessageConsumerSpec
      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 interface ReactiveMessageConsumerSpec
      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 interface ReactiveMessageConsumerSpec
      Returns:
      the action the consumer will take in case of decryption failures
      See Also:
      • ConsumerBuilder.cryptoFailureAction(org.apache.pulsar.client.api.ConsumerCryptoFailureAction)
    • getMaxPendingChunkedMessage

      public Integer getMaxPendingChunkedMessage()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets the maximum number of messages in the queue holding pending chunked messages.
      Specified by:
      getMaxPendingChunkedMessage in interface ReactiveMessageConsumerSpec
      Returns:
      the maximum number of messages in the queue holding pending chunked
      See Also:
      • messages.
    • getAutoAckOldestChunkedMessageOnQueueFull

      public Boolean getAutoAckOldestChunkedMessageOnQueueFull()
      Description copied from interface: ReactiveMessageConsumerSpec
      Gets whether to automatically acknowledge pending chunked messages when maxPendingChunkedMessage is reached.
      Specified by:
      getAutoAckOldestChunkedMessageOnQueueFull in interface ReactiveMessageConsumerSpec
      Returns:
      true to acknowledge the messages, false to have them redelivered.
      See Also:
      • ConsumerBuilder.autoAckOldestChunkedMessageOnQueueFull(boolean)
      • ConsumerBuilder.maxPendingChunkedMessage(int)
    • getExpireTimeOfIncompleteChunkedMessage

      public 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 interface ReactiveMessageConsumerSpec
      Returns:
      the time interval to expire incomplete chunks.
      See Also:
      • ConsumerBuilder.expireTimeOfIncompleteChunkedMessage(long, java.util.concurrent.TimeUnit)