Class MutableReactiveMessageSenderSpec

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void applySpec​(ReactiveMessageSenderSpec senderSpec)
      Updates this spec from the defined values of another spec.
      org.apache.pulsar.client.api.ProducerAccessMode getAccessMode()
      Gets the type of access mode that the producer requires on the topic.
      java.lang.Boolean getAutoUpdatePartitions()
      Gets whether partitioned producer will automatically discover new partitions at runtime.
      java.time.Duration getAutoUpdatePartitionsInterval()
      Gets the interval of partitions updates if autoUpdatePartitions is enabled.
      org.apache.pulsar.client.api.BatcherBuilder getBatcherBuilder()
      Gets the batcher builder of the producer.
      java.lang.Boolean getBatchingEnabled()
      Gets whether automatic batching of messages is enabled for the producer.
      java.lang.Integer getBatchingMaxBytes()
      Gets the maximum number of bytes permitted in a batch.
      java.lang.Integer getBatchingMaxMessages()
      Gets the maximum number of messages permitted in a batch.
      java.time.Duration getBatchingMaxPublishDelay()
      Gets the time period within which the messages sent will be batched.
      java.lang.Boolean getChunkingEnabled()
      Gets whether chunking of messages is enabled.
      org.apache.pulsar.client.api.CompressionType getCompressionType()
      Gets the compression type for the producer.
      org.apache.pulsar.client.api.ProducerCryptoFailureAction getCryptoFailureAction()
      Gets the action the producer will take in case of encryption failures.
      org.apache.pulsar.client.api.CryptoKeyReader getCryptoKeyReader()
      Gets the key reader to be used to encrypt the message payloads.
      java.util.Set<java.lang.String> getEncryptionKeys()
      Gets the public encryption key names, used by producer to encrypt the data key.
      org.apache.pulsar.client.api.HashingScheme getHashingScheme()
      Gets the hashing function determining the partition where to publish a particular message on partitioned topics.
      java.lang.Long getInitialSequenceId()
      Gets the baseline for the sequence ids for messages published by the producer.
      java.lang.Boolean getLazyStartPartitionedProducers()
      Gets whether producers register and connect immediately to the owner broker of each partition or start lazily on demand.
      java.lang.Integer getMaxPendingMessages()
      Gets the maximum size of the queue holding the messages pending to receive an acknowledgment from the broker.
      java.lang.Integer getMaxPendingMessagesAcrossPartitions()
      Gets the maximum number of pending messages across all the partitions.
      org.apache.pulsar.client.api.MessageRouter getMessageRouter()
      Gets the custom message router.
      org.apache.pulsar.client.api.MessageRoutingMode getMessageRoutingMode()
      Gets the message routing logic for producers on partitioned topics.
      java.lang.Boolean getMultiSchema()
      Gets whether the multiple schema mode is enabled.
      java.lang.String getProducerName()
      Gets the name of the producer.
      java.util.Map<java.lang.String,​java.lang.String> getProperties()
      Gets the properties of the producer.
      java.lang.Integer getRoundRobinRouterBatchingPartitionSwitchFrequency()
      Gets the partition switch frequency while batching of messages is enabled and using round-robin routing mode for non-keyed message.
      java.time.Duration getSendTimeout()
      Gets the send timeout.
      java.lang.String getTopicName()
      Gets the topic to publish on.
      void setAccessMode​(org.apache.pulsar.client.api.ProducerAccessMode accessMode)
      Sets the type of access mode that the producer requires on the topic.
      void setAutoUpdatePartitions​(java.lang.Boolean autoUpdatePartitions)
      Sets whether partitioned producer will automatically discover new partitions at runtime.
      void setAutoUpdatePartitionsInterval​(java.time.Duration autoUpdatePartitionsInterval)
      Sets the interval of partitions updates if autoUpdatePartitions is enabled.
      void setBatcherBuilder​(org.apache.pulsar.client.api.BatcherBuilder batcherBuilder)
      Sets the batcher builder of the producer.
      void setBatchingEnabled​(java.lang.Boolean batchingEnabled)
      Sets whether automatic batching of messages is enabled for the producer.
      void setBatchingMaxBytes​(java.lang.Integer batchingMaxBytes)
      Sets the maximum number of bytes permitted in a batch.
      void setBatchingMaxMessages​(java.lang.Integer batchingMaxMessages)
      Sets the maximum number of messages permitted in a batch.
      void setBatchingMaxPublishDelay​(java.time.Duration batchingMaxPublishDelay)
      Sets the time period within which the messages sent will be batched.
      void setChunkingEnabled​(java.lang.Boolean chunkingEnabled)
      Sets whether chunking of messages is enabled.
      void setCompressionType​(org.apache.pulsar.client.api.CompressionType compressionType)
      Sets the compression type for the producer.
      void setCryptoFailureAction​(org.apache.pulsar.client.api.ProducerCryptoFailureAction cryptoFailureAction)
      Sets the action the producer will take in case of encryption failures.
      void setCryptoKeyReader​(org.apache.pulsar.client.api.CryptoKeyReader cryptoKeyReader)
      Sets the key reader to be used to encrypt the message payloads.
      void setEncryptionKeys​(java.util.Set<java.lang.String> encryptionKeys)
      Sets the public encryption key names, used by producer to encrypt the data key.
      void setHashingScheme​(org.apache.pulsar.client.api.HashingScheme hashingScheme)
      Sets the hashing function determining the partition where to publish a particular message on partitioned topics.
      void setInitialSequenceId​(java.lang.Long initialSequenceId)
      Sets the baseline for the sequence ids for messages published by the producer.
      void setLazyStartPartitionedProducers​(java.lang.Boolean lazyStartPartitionedProducers)
      Sets whether producers register and connect immediately to the owner broker of each partition or start lazily on demand.
      void setMaxPendingMessages​(java.lang.Integer maxPendingMessages)
      Sets the maximum size of the queue holding the messages pending to receive an acknowledgment from the broker.
      void setMaxPendingMessagesAcrossPartitions​(java.lang.Integer maxPendingMessagesAcrossPartitions)
      Sets the maximum number of pending messages across all the partitions.
      void setMessageRouter​(org.apache.pulsar.client.api.MessageRouter messageRouter)
      Sets a custom message router.
      void setMessageRoutingMode​(org.apache.pulsar.client.api.MessageRoutingMode messageRoutingMode)
      Sets the message routing logic for producers on partitioned topics.
      void setMultiSchema​(java.lang.Boolean multiSchema)
      Sets whether the multiple schema mode is enabled.
      void setProducerName​(java.lang.String producerName)
      Sets the name of the producer.
      void setProperties​(java.util.Map<java.lang.String,​java.lang.String> properties)
      Sets the properties of the producer.
      void setRoundRobinRouterBatchingPartitionSwitchFrequency​(java.lang.Integer roundRobinRouterBatchingPartitionSwitchFrequency)
      Sets the partition switch frequency while batching of messages is enabled and using round-robin routing mode for non-keyed message.
      void setSendTimeout​(java.time.Duration sendTimeout)
      Sets the send timeout.
      void setTopicName​(java.lang.String topicName)
      Sets the topic to publish on.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MutableReactiveMessageSenderSpec

        public MutableReactiveMessageSenderSpec()
        Constructs a default MutableReactiveMessageSenderSpec.
      • MutableReactiveMessageSenderSpec

        public MutableReactiveMessageSenderSpec​(ReactiveMessageSenderSpec senderSpec)
        Constructs a MutableReactiveMessageSenderSpec from another ReactiveMessageSenderSpec.
        Parameters:
        senderSpec - the spec to construct from
    • Method Detail

      • setTopicName

        public void setTopicName​(java.lang.String topicName)
        Sets the topic to publish on.
        Parameters:
        topicName - the topic
      • setProducerName

        public void setProducerName​(java.lang.String producerName)
        Sets the name of the producer.
        Parameters:
        producerName - the producer name
      • setSendTimeout

        public void setSendTimeout​(java.time.Duration sendTimeout)
        Sets the send timeout.
        Parameters:
        sendTimeout - the send timeout
      • getMaxPendingMessages

        public java.lang.Integer getMaxPendingMessages()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the maximum size of the queue holding the messages pending to receive an acknowledgment from the broker.
        Specified by:
        getMaxPendingMessages in interface ReactiveMessageSenderSpec
        Returns:
        the maximum pending messages
        See Also:
        ProducerBuilder.maxPendingMessages(int)
      • setMaxPendingMessages

        public void setMaxPendingMessages​(java.lang.Integer maxPendingMessages)
        Sets the maximum size of the queue holding the messages pending to receive an acknowledgment from the broker.
        Parameters:
        maxPendingMessages - the maximum pending messages
      • getMaxPendingMessagesAcrossPartitions

        public java.lang.Integer getMaxPendingMessagesAcrossPartitions()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the maximum number of pending messages across all the partitions.
        Specified by:
        getMaxPendingMessagesAcrossPartitions in interface ReactiveMessageSenderSpec
        Returns:
        the maximum number of pending messages across all the partitions
        See Also:
        ProducerBuilder.maxPendingMessagesAcrossPartitions(int)
      • setMaxPendingMessagesAcrossPartitions

        public void setMaxPendingMessagesAcrossPartitions​(java.lang.Integer maxPendingMessagesAcrossPartitions)
        Sets the maximum number of pending messages across all the partitions.
        Parameters:
        maxPendingMessagesAcrossPartitions - the maximum number of pending messages across all the partitions
      • getMessageRoutingMode

        public org.apache.pulsar.client.api.MessageRoutingMode getMessageRoutingMode()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the message routing logic for producers on partitioned topics.
        Specified by:
        getMessageRoutingMode in interface ReactiveMessageSenderSpec
        Returns:
        the message routing mode
        See Also:
        ProducerBuilder.messageRoutingMode(org.apache.pulsar.client.api.MessageRoutingMode)
      • setMessageRoutingMode

        public void setMessageRoutingMode​(org.apache.pulsar.client.api.MessageRoutingMode messageRoutingMode)
        Sets the message routing logic for producers on partitioned topics.
        Parameters:
        messageRoutingMode - the message routing mode
      • getHashingScheme

        public org.apache.pulsar.client.api.HashingScheme getHashingScheme()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the hashing function determining the partition where to publish a particular message on partitioned topics.
        Specified by:
        getHashingScheme in interface ReactiveMessageSenderSpec
        Returns:
        the hashing scheme
        See Also:
        ProducerBuilder.hashingScheme(org.apache.pulsar.client.api.HashingScheme)
      • setHashingScheme

        public void setHashingScheme​(org.apache.pulsar.client.api.HashingScheme hashingScheme)
        Sets the hashing function determining the partition where to publish a particular message on partitioned topics.
        Parameters:
        hashingScheme - the hashing scheme
      • getCryptoFailureAction

        public org.apache.pulsar.client.api.ProducerCryptoFailureAction getCryptoFailureAction()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the action the producer will take in case of encryption failures.
        Specified by:
        getCryptoFailureAction in interface ReactiveMessageSenderSpec
        Returns:
        the action the producer will take in case of encryption failures
        See Also:
        ProducerBuilder.cryptoFailureAction(org.apache.pulsar.client.api.ProducerCryptoFailureAction)
      • setCryptoFailureAction

        public void setCryptoFailureAction​(org.apache.pulsar.client.api.ProducerCryptoFailureAction cryptoFailureAction)
        Sets the action the producer will take in case of encryption failures.
        Parameters:
        cryptoFailureAction - the action the producer will take in case of encryption failures
      • getMessageRouter

        public org.apache.pulsar.client.api.MessageRouter getMessageRouter()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the custom message router.
        Specified by:
        getMessageRouter in interface ReactiveMessageSenderSpec
        Returns:
        the message router
        See Also:
        ProducerBuilder.messageRouter(org.apache.pulsar.client.api.MessageRouter)
      • setMessageRouter

        public void setMessageRouter​(org.apache.pulsar.client.api.MessageRouter messageRouter)
        Sets a custom message router.
        Parameters:
        messageRouter - the message router
      • getBatchingMaxPublishDelay

        public java.time.Duration getBatchingMaxPublishDelay()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the time period within which the messages sent will be batched.
        Specified by:
        getBatchingMaxPublishDelay in interface ReactiveMessageSenderSpec
        Returns:
        the batch delay
        See Also:
        ProducerBuilder.batchingMaxPublishDelay(long, java.util.concurrent.TimeUnit)
      • setBatchingMaxPublishDelay

        public void setBatchingMaxPublishDelay​(java.time.Duration batchingMaxPublishDelay)
        Sets the time period within which the messages sent will be batched.
        Parameters:
        batchingMaxPublishDelay - the batch delay
      • getRoundRobinRouterBatchingPartitionSwitchFrequency

        public java.lang.Integer getRoundRobinRouterBatchingPartitionSwitchFrequency()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the partition switch frequency while batching of messages is enabled and using round-robin routing mode for non-keyed message.
        Specified by:
        getRoundRobinRouterBatchingPartitionSwitchFrequency in interface ReactiveMessageSenderSpec
        Returns:
        the frequency of partition switch
        See Also:
        ProducerBuilder.roundRobinRouterBatchingPartitionSwitchFrequency(int)
      • setRoundRobinRouterBatchingPartitionSwitchFrequency

        public void setRoundRobinRouterBatchingPartitionSwitchFrequency​(java.lang.Integer roundRobinRouterBatchingPartitionSwitchFrequency)
        Sets the partition switch frequency while batching of messages is enabled and using round-robin routing mode for non-keyed message.
        Parameters:
        roundRobinRouterBatchingPartitionSwitchFrequency - the frequency of partition switch
      • getBatchingMaxMessages

        public java.lang.Integer getBatchingMaxMessages()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the maximum number of messages permitted in a batch.
        Specified by:
        getBatchingMaxMessages in interface ReactiveMessageSenderSpec
        Returns:
        the maximum number of messages in a batch
        See Also:
        ProducerBuilder.batchingMaxMessages(int)
      • setBatchingMaxMessages

        public void setBatchingMaxMessages​(java.lang.Integer batchingMaxMessages)
        Sets the maximum number of messages permitted in a batch.
        Parameters:
        batchingMaxMessages - the maximum number of messages in a batch
      • getBatchingMaxBytes

        public java.lang.Integer getBatchingMaxBytes()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the maximum number of bytes permitted in a batch.
        Specified by:
        getBatchingMaxBytes in interface ReactiveMessageSenderSpec
        Returns:
        the maximum bytes of messages in a batch
        See Also:
        ProducerBuilder.batchingMaxBytes(int)
      • setBatchingMaxBytes

        public void setBatchingMaxBytes​(java.lang.Integer batchingMaxBytes)
        Sets the maximum number of bytes permitted in a batch.
        Parameters:
        batchingMaxBytes - the maximum number of bytes in a batch
      • getBatchingEnabled

        public java.lang.Boolean getBatchingEnabled()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets whether automatic batching of messages is enabled for the producer.
        Specified by:
        getBatchingEnabled in interface ReactiveMessageSenderSpec
        Returns:
        true if batching is enabled
        See Also:
        ProducerBuilder.enableBatching(boolean)
      • setBatchingEnabled

        public void setBatchingEnabled​(java.lang.Boolean batchingEnabled)
        Sets whether automatic batching of messages is enabled for the producer.
        Parameters:
        batchingEnabled - true to enable batching
      • getBatcherBuilder

        public org.apache.pulsar.client.api.BatcherBuilder getBatcherBuilder()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the batcher builder of the producer.
        Specified by:
        getBatcherBuilder in interface ReactiveMessageSenderSpec
        Returns:
        the batcher builder
        See Also:
        ProducerBuilder.batcherBuilder(org.apache.pulsar.client.api.BatcherBuilder)
      • setBatcherBuilder

        public void setBatcherBuilder​(org.apache.pulsar.client.api.BatcherBuilder batcherBuilder)
        Sets the batcher builder of the producer.
        Parameters:
        batcherBuilder - the batcher builder
      • getChunkingEnabled

        public java.lang.Boolean getChunkingEnabled()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets whether chunking of messages is enabled.
        Specified by:
        getChunkingEnabled in interface ReactiveMessageSenderSpec
        Returns:
        true if message chunking is enabled
        See Also:
        ProducerBuilder.enableChunking(boolean)
      • setChunkingEnabled

        public void setChunkingEnabled​(java.lang.Boolean chunkingEnabled)
        Sets whether chunking of messages is enabled.
        Parameters:
        chunkingEnabled - true to enable message chunking
      • getCryptoKeyReader

        public org.apache.pulsar.client.api.CryptoKeyReader getCryptoKeyReader()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the key reader to be used to encrypt the message payloads.
        Specified by:
        getCryptoKeyReader in interface ReactiveMessageSenderSpec
        Returns:
        the key reader to be used to encrypt the message payloads
        See Also:
        ProducerBuilder.cryptoKeyReader(org.apache.pulsar.client.api.CryptoKeyReader)
      • setCryptoKeyReader

        public void setCryptoKeyReader​(org.apache.pulsar.client.api.CryptoKeyReader cryptoKeyReader)
        Sets the key reader to be used to encrypt the message payloads.
        Parameters:
        cryptoKeyReader - the key reader to be used to encrypt the message payloads
      • getEncryptionKeys

        public java.util.Set<java.lang.String> getEncryptionKeys()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the public encryption key names, used by producer to encrypt the data key.
        Specified by:
        getEncryptionKeys in interface ReactiveMessageSenderSpec
        Returns:
        the public encryption key names
        See Also:
        ProducerBuilder.addEncryptionKey(java.lang.String)
      • setEncryptionKeys

        public void setEncryptionKeys​(java.util.Set<java.lang.String> encryptionKeys)
        Sets the public encryption key names, used by producer to encrypt the data key.
        Parameters:
        encryptionKeys - the public encryption key names
      • getCompressionType

        public org.apache.pulsar.client.api.CompressionType getCompressionType()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the compression type for the producer.
        Specified by:
        getCompressionType in interface ReactiveMessageSenderSpec
        Returns:
        the compression type
        See Also:
        ProducerBuilder.compressionType(org.apache.pulsar.client.api.CompressionType)
      • setCompressionType

        public void setCompressionType​(org.apache.pulsar.client.api.CompressionType compressionType)
        Sets the compression type for the producer.
        Parameters:
        compressionType - the compression type
      • getInitialSequenceId

        public java.lang.Long getInitialSequenceId()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the baseline for the sequence ids for messages published by the producer.
        Specified by:
        getInitialSequenceId in interface ReactiveMessageSenderSpec
        Returns:
        the initial sequence id
        See Also:
        ProducerBuilder.initialSequenceId(long)
      • setInitialSequenceId

        public void setInitialSequenceId​(java.lang.Long initialSequenceId)
        Sets the baseline for the sequence ids for messages published by the producer.
        Parameters:
        initialSequenceId - the initial sequence id
      • getAutoUpdatePartitions

        public java.lang.Boolean getAutoUpdatePartitions()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets whether partitioned producer will automatically discover new partitions at runtime.
        Specified by:
        getAutoUpdatePartitions in interface ReactiveMessageSenderSpec
        Returns:
        true if auto discovery of the partition configuration changes is enabled
        See Also:
        ProducerBuilder.autoUpdatePartitions(boolean)
      • setAutoUpdatePartitions

        public void setAutoUpdatePartitions​(java.lang.Boolean autoUpdatePartitions)
        Sets whether partitioned producer will automatically discover new partitions at runtime.
        Parameters:
        autoUpdatePartitions - true to enable auto discovery of the partition configuration changes
      • getAutoUpdatePartitionsInterval

        public java.time.Duration getAutoUpdatePartitionsInterval()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the interval of partitions updates if autoUpdatePartitions is enabled.
        Specified by:
        getAutoUpdatePartitionsInterval in interface ReactiveMessageSenderSpec
        Returns:
        the interval of partitions updates
        See Also:
        ProducerBuilder.autoUpdatePartitionsInterval(int, java.util.concurrent.TimeUnit)
      • setAutoUpdatePartitionsInterval

        public void setAutoUpdatePartitionsInterval​(java.time.Duration autoUpdatePartitionsInterval)
        Sets the interval of partitions updates if autoUpdatePartitions is enabled.
        Parameters:
        autoUpdatePartitionsInterval - the interval of partitions updates
      • getMultiSchema

        public java.lang.Boolean getMultiSchema()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets whether the multiple schema mode is enabled.
        Specified by:
        getMultiSchema in interface ReactiveMessageSenderSpec
        Returns:
        true if the multiple schema mode is enabled
        See Also:
        ProducerBuilder.enableMultiSchema(boolean)
      • setMultiSchema

        public void setMultiSchema​(java.lang.Boolean multiSchema)
        Sets whether the multiple schema mode is enabled.
        Parameters:
        multiSchema - true to enable the multiple schema mode
      • getAccessMode

        public org.apache.pulsar.client.api.ProducerAccessMode getAccessMode()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the type of access mode that the producer requires on the topic.
        Specified by:
        getAccessMode in interface ReactiveMessageSenderSpec
        Returns:
        the access mode
        See Also:
        ProducerBuilder.accessMode(org.apache.pulsar.client.api.ProducerAccessMode)
      • setAccessMode

        public void setAccessMode​(org.apache.pulsar.client.api.ProducerAccessMode accessMode)
        Sets the type of access mode that the producer requires on the topic.
        Parameters:
        accessMode - the access mode
      • getLazyStartPartitionedProducers

        public java.lang.Boolean getLazyStartPartitionedProducers()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets whether producers register and connect immediately to the owner broker of each partition or start lazily on demand.
        Specified by:
        getLazyStartPartitionedProducers in interface ReactiveMessageSenderSpec
        Returns:
        true if lazy starting of partitioned producers is enabled
        See Also:
        ProducerBuilder.enableLazyStartPartitionedProducers(boolean)
      • setLazyStartPartitionedProducers

        public void setLazyStartPartitionedProducers​(java.lang.Boolean lazyStartPartitionedProducers)
        Sets whether producers register and connect immediately to the owner broker of each partition or start lazily on demand.
        Parameters:
        lazyStartPartitionedProducers - true to enable lazy starting of partitioned producers
      • getProperties

        public java.util.Map<java.lang.String,​java.lang.String> getProperties()
        Description copied from interface: ReactiveMessageSenderSpec
        Gets the properties of the producer.
        Specified by:
        getProperties in interface ReactiveMessageSenderSpec
        Returns:
        the properties of the producer
        See Also:
        ProducerBuilder.properties(java.util.Map<java.lang.String, java.lang.String>)
      • setProperties

        public void setProperties​(java.util.Map<java.lang.String,​java.lang.String> properties)
        Sets the properties of the producer.
        Parameters:
        properties - the properties of the producer
      • applySpec

        public void applySpec​(ReactiveMessageSenderSpec senderSpec)
        Updates this spec from the defined values of another spec.
        Parameters:
        senderSpec - the spec from which to update