Class PulsarConfiguration
- java.lang.Object
-
- org.apache.camel.component.pulsar.PulsarConfiguration
-
-
Constructor Summary
Constructors Constructor Description PulsarConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description PulsarConfigurationcopy()Returns a copy of this configurationlonggetAckGroupTimeMillis()longgetAckTimeoutMillis()org.apache.pulsar.client.api.RedeliveryBackoffgetAckTimeoutRedeliveryBackoff()StringgetAuthenticationClass()StringgetAuthenticationParams()org.apache.pulsar.client.api.BatcherBuildergetBatcherBuilder()intgetBatchingMaxMessages()longgetBatchingMaxPublishDelayMicros()org.apache.pulsar.client.api.CompressionTypegetCompressionType()StringgetConsumerName()StringgetConsumerNamePrefix()intgetConsumerQueueSize()StringgetDeadLetterTopic()longgetInitialSequenceId()intgetMaxPendingMessages()intgetMaxPendingMessagesAcrossPartitions()Deprecated.IntegergetMaxRedeliverCount()org.apache.pulsar.client.api.MessageRoutergetMessageRouter()Set a custom Message Router.org.apache.pulsar.client.api.MessageRoutingModegetMessageRoutingMode()Set the message routing mode for the producer.org.apache.pulsar.client.api.RedeliveryBackoffgetNegativeAckRedeliveryBackoff()longgetNegativeAckRedeliveryDelayMicros()intgetNumberOfConsumers()intgetNumberOfConsumerThreads()StringgetProducerName()intgetSendTimeoutMs()StringgetServiceUrl()SubscriptionInitialPositiongetSubscriptionInitialPosition()StringgetSubscriptionName()org.apache.pulsar.client.api.RegexSubscriptionModegetSubscriptionTopicsMode()SubscriptionTypegetSubscriptionType()booleanisAllowManualAcknowledgement()booleanisBatchingEnabled()booleanisBlockIfQueueFull()booleanisMessageListener()booleanisReadCompacted()Enable compacted topic reading.booleanisTopicsPattern()voidsetAckGroupTimeMillis(long ackGroupTimeMillis)Group the consumer acknowledgments for the specified time in milliseconds - defaults to 100voidsetAckTimeoutMillis(long ackTimeoutMillis)Timeout for unacknowledged messages in milliseconds - defaults to 10000voidsetAckTimeoutRedeliveryBackoff(org.apache.pulsar.client.api.RedeliveryBackoff redeliveryBackoff)Set a RedeliveryBackoff to use for ack timeout redelivery backoff.voidsetAllowManualAcknowledgement(boolean allowManualAcknowledgement)Whether to allow manual message acknowledgements.voidsetAuthenticationClass(String authenticationClass)The Authentication FQCN to be used while creating the client from URIvoidsetAuthenticationParams(String authenticationParams)The Authentication Parameters to be used while creating the client from URIvoidsetBatcherBuilder(org.apache.pulsar.client.api.BatcherBuilder batcherBuilder)Control batching method of the Pulsar producer.voidsetBatchingEnabled(boolean batchingEnabled)Control whether automatic batching of messages is enabled for the producer.voidsetBatchingMaxMessages(int batchingMaxMessages)Set the maximum number of messages permitted in a batch.voidsetBatchingMaxPublishDelayMicros(long batchingMaxPublishDelayMicros)Set the time period within which the messages sent will be batched if batch messages are enabled.voidsetBlockIfQueueFull(boolean blockIfQueueFull)Set whether the send and asyncSend operations should block when the outgoing message queue is full.voidsetCompressionType(String compressionType)Set the compression type for the producer.voidsetCompressionType(org.apache.pulsar.client.api.CompressionType compressionType)Set the compression type for the producer.voidsetConsumerName(String consumerName)Name of the consumer when subscription is EXCLUSIVEvoidsetConsumerNamePrefix(String consumerNamePrefix)Prefix to add to consumer names when a SHARED or FAILOVER subscription is usedvoidsetConsumerQueueSize(int consumerQueueSize)Size of the consumer queue - defaults to 10voidsetDeadLetterTopic(String deadLetterTopic)voidsetInitialSequenceId(long initialSequenceId)Set the baseline for the sequence ids for messages published by the producer.voidsetMaxPendingMessages(int maxPendingMessages)Set the max size of the queue holding the messages pending to receive an acknowledgment from the broker.voidsetMaxPendingMessagesAcrossPartitions(int maxPendingMessagesAcrossPartitions)Deprecated.voidsetMaxRedeliverCount(Integer maxRedeliverCount)voidsetMessageListener(boolean messageListener)voidsetMessageRouter(org.apache.pulsar.client.api.MessageRouter messageRouter)voidsetMessageRoutingMode(org.apache.pulsar.client.api.MessageRoutingMode messageRoutingMode)voidsetNegativeAckRedeliveryBackoff(org.apache.pulsar.client.api.RedeliveryBackoff redeliveryBackoff)Set a RedeliveryBackoff to use for negative ack redelivery backoff.voidsetNegativeAckRedeliveryDelayMicros(long negativeAckRedeliveryDelayMicros)Set the negative acknowledgement delayvoidsetNumberOfConsumers(int numberOfConsumers)Number of consumers - defaults to 1voidsetNumberOfConsumerThreads(int numberOfConsumerThreads)Number of consumers threads - defaults to 1voidsetProducerName(String producerName)Name of the producer.voidsetReadCompacted(boolean readCompacted)voidsetSendTimeoutMs(int sendTimeoutMs)Send timeout in milliseconds.voidsetServiceUrl(String serviceUrl)The Pulsar Service URL to point while creating the client from URIvoidsetSubscriptionInitialPosition(SubscriptionInitialPosition subscriptionInitialPosition)Control the initial position in the topic of a newly created subscription.voidsetSubscriptionName(String subscriptionName)Name of the subscription to usevoidsetSubscriptionTopicsMode(org.apache.pulsar.client.api.RegexSubscriptionMode subscriptionTopicsMode)Determines to which topics this consumer should be subscribed to - Persistent, Non-Persistent, or both.voidsetSubscriptionType(SubscriptionType subscriptionType)Type of the subscription [EXCLUSIVE|SHARED|FAILOVER|KEY_SHARED], defaults to EXCLUSIVEvoidsetTopicsPattern(boolean topicsPattern)Whether the topic is a pattern (regular expression) that allows the consumer to subscribe to all matching topics in the namespace
-
-
-
Method Detail
-
copy
public PulsarConfiguration copy()
Returns a copy of this configuration
-
isTopicsPattern
public boolean isTopicsPattern()
-
setTopicsPattern
public void setTopicsPattern(boolean topicsPattern)
Whether the topic is a pattern (regular expression) that allows the consumer to subscribe to all matching topics in the namespace
-
getSubscriptionTopicsMode
public org.apache.pulsar.client.api.RegexSubscriptionMode getSubscriptionTopicsMode()
-
setSubscriptionTopicsMode
public void setSubscriptionTopicsMode(org.apache.pulsar.client.api.RegexSubscriptionMode subscriptionTopicsMode)
Determines to which topics this consumer should be subscribed to - Persistent, Non-Persistent, or both. Only used with pattern subscriptions.
-
getSubscriptionName
public String getSubscriptionName()
-
setSubscriptionName
public void setSubscriptionName(String subscriptionName)
Name of the subscription to use
-
getSubscriptionType
public SubscriptionType getSubscriptionType()
-
setSubscriptionType
public void setSubscriptionType(SubscriptionType subscriptionType)
Type of the subscription [EXCLUSIVE|SHARED|FAILOVER|KEY_SHARED], defaults to EXCLUSIVE
-
getNumberOfConsumers
public int getNumberOfConsumers()
-
setNumberOfConsumers
public void setNumberOfConsumers(int numberOfConsumers)
Number of consumers - defaults to 1
-
getConsumerQueueSize
public int getConsumerQueueSize()
-
setConsumerQueueSize
public void setConsumerQueueSize(int consumerQueueSize)
Size of the consumer queue - defaults to 10
-
getConsumerName
public String getConsumerName()
-
setConsumerName
public void setConsumerName(String consumerName)
Name of the consumer when subscription is EXCLUSIVE
-
getProducerName
public String getProducerName()
-
setProducerName
public void setProducerName(String producerName)
Name of the producer. If unset, lets Pulsar select a unique identifier.
-
getConsumerNamePrefix
public String getConsumerNamePrefix()
-
setConsumerNamePrefix
public void setConsumerNamePrefix(String consumerNamePrefix)
Prefix to add to consumer names when a SHARED or FAILOVER subscription is used
-
isAllowManualAcknowledgement
public boolean isAllowManualAcknowledgement()
-
setAllowManualAcknowledgement
public void setAllowManualAcknowledgement(boolean allowManualAcknowledgement)
Whether to allow manual message acknowledgements. If this option is enabled, then messages are not acknowledged automatically after successful route completion. Instead, an instance ofPulsarMessageReceiptis stored as a header on theExchange. Messages can then be acknowledged usingPulsarMessageReceiptat any time before the ackTimeout occurs.
-
getAckTimeoutMillis
public long getAckTimeoutMillis()
-
setAckTimeoutMillis
public void setAckTimeoutMillis(long ackTimeoutMillis)
Timeout for unacknowledged messages in milliseconds - defaults to 10000
-
getAckGroupTimeMillis
public long getAckGroupTimeMillis()
-
setAckGroupTimeMillis
public void setAckGroupTimeMillis(long ackGroupTimeMillis)
Group the consumer acknowledgments for the specified time in milliseconds - defaults to 100
-
setSendTimeoutMs
public void setSendTimeoutMs(int sendTimeoutMs)
Send timeout in milliseconds. Defaults to 30,000ms (30 seconds)
-
getSendTimeoutMs
public int getSendTimeoutMs()
-
setBlockIfQueueFull
public void setBlockIfQueueFull(boolean blockIfQueueFull)
Set whether the send and asyncSend operations should block when the outgoing message queue is full. If set to false, send operations will immediately fail with ProducerQueueIsFullError when there is no space left in the pending queue. Default is false.
-
isBlockIfQueueFull
public boolean isBlockIfQueueFull()
-
setMaxPendingMessages
public void setMaxPendingMessages(int maxPendingMessages)
Set the max size of the queue holding the messages pending to receive an acknowledgment from the broker. Default is 1000.
-
getMaxPendingMessages
public int getMaxPendingMessages()
-
setMaxPendingMessagesAcrossPartitions
@Deprecated public void setMaxPendingMessagesAcrossPartitions(int maxPendingMessagesAcrossPartitions)
Deprecated.Set the number of max pending messages across all the partitions. Default is 50000. This option is deprecated and will be removed in a future version.
-
getMaxPendingMessagesAcrossPartitions
@Deprecated public int getMaxPendingMessagesAcrossPartitions()
Deprecated.
-
setBatchingMaxPublishDelayMicros
public void setBatchingMaxPublishDelayMicros(long batchingMaxPublishDelayMicros)
Set the time period within which the messages sent will be batched if batch messages are enabled. If set to a non zero value, messages will be queued until either:- this time interval expires
- the max number of messages in a batch is reached
-
getBatchingMaxPublishDelayMicros
public long getBatchingMaxPublishDelayMicros()
-
setBatchingMaxMessages
public void setBatchingMaxMessages(int batchingMaxMessages)
Set the maximum number of messages permitted in a batch. Default 1,000.
-
getBatchingMaxMessages
public int getBatchingMaxMessages()
-
setBatchingEnabled
public void setBatchingEnabled(boolean batchingEnabled)
Control whether automatic batching of messages is enabled for the producer. Default is true.
-
isBatchingEnabled
public boolean isBatchingEnabled()
-
setBatcherBuilder
public void setBatcherBuilder(org.apache.pulsar.client.api.BatcherBuilder batcherBuilder)
Control batching method of the Pulsar producer. KEY_BASED batches based on the Pulsar message key. DEFAULT batches all messages together regardless of key; this may cause only a single consumer to work when consuming using a KEY_SHARED subscription. Default is DEFAULT.
-
getBatcherBuilder
public org.apache.pulsar.client.api.BatcherBuilder getBatcherBuilder()
-
setSubscriptionInitialPosition
public void setSubscriptionInitialPosition(SubscriptionInitialPosition subscriptionInitialPosition)
Control the initial position in the topic of a newly created subscription. Default is latest message.
-
getSubscriptionInitialPosition
public SubscriptionInitialPosition getSubscriptionInitialPosition()
-
isReadCompacted
public boolean isReadCompacted()
Enable compacted topic reading.
-
setReadCompacted
public void setReadCompacted(boolean readCompacted)
-
setInitialSequenceId
public void setInitialSequenceId(long initialSequenceId)
Set the baseline for the sequence ids for messages published by the producer. First message will be using (initialSequenceId 1) as its sequence id and subsequent messages will be assigned incremental sequence ids, if not otherwise specified.
-
getInitialSequenceId
public long getInitialSequenceId()
-
setCompressionType
public void setCompressionType(String compressionType)
Set the compression type for the producer.
-
setCompressionType
public void setCompressionType(org.apache.pulsar.client.api.CompressionType compressionType)
Set the compression type for the producer.
-
getCompressionType
public org.apache.pulsar.client.api.CompressionType getCompressionType()
-
getMessageRoutingMode
public org.apache.pulsar.client.api.MessageRoutingMode getMessageRoutingMode()
Set the message routing mode for the producer.
-
setMessageRoutingMode
public void setMessageRoutingMode(org.apache.pulsar.client.api.MessageRoutingMode messageRoutingMode)
-
getMessageRouter
public org.apache.pulsar.client.api.MessageRouter getMessageRouter()
Set a custom Message Router.
-
setMessageRouter
public void setMessageRouter(org.apache.pulsar.client.api.MessageRouter messageRouter)
-
getNegativeAckRedeliveryDelayMicros
public long getNegativeAckRedeliveryDelayMicros()
-
setNegativeAckRedeliveryDelayMicros
public void setNegativeAckRedeliveryDelayMicros(long negativeAckRedeliveryDelayMicros)
Set the negative acknowledgement delay
-
getAckTimeoutRedeliveryBackoff
public org.apache.pulsar.client.api.RedeliveryBackoff getAckTimeoutRedeliveryBackoff()
-
setAckTimeoutRedeliveryBackoff
public void setAckTimeoutRedeliveryBackoff(org.apache.pulsar.client.api.RedeliveryBackoff redeliveryBackoff)
Set a RedeliveryBackoff to use for ack timeout redelivery backoff.
-
getNegativeAckRedeliveryBackoff
public org.apache.pulsar.client.api.RedeliveryBackoff getNegativeAckRedeliveryBackoff()
-
setNegativeAckRedeliveryBackoff
public void setNegativeAckRedeliveryBackoff(org.apache.pulsar.client.api.RedeliveryBackoff redeliveryBackoff)
Set a RedeliveryBackoff to use for negative ack redelivery backoff.
-
getMaxRedeliverCount
public Integer getMaxRedeliverCount()
-
setMaxRedeliverCount
public void setMaxRedeliverCount(Integer maxRedeliverCount)
-
getDeadLetterTopic
public String getDeadLetterTopic()
-
setDeadLetterTopic
public void setDeadLetterTopic(String deadLetterTopic)
-
isMessageListener
public boolean isMessageListener()
-
setMessageListener
public void setMessageListener(boolean messageListener)
-
getNumberOfConsumerThreads
public int getNumberOfConsumerThreads()
-
setNumberOfConsumerThreads
public void setNumberOfConsumerThreads(int numberOfConsumerThreads)
Number of consumers threads - defaults to 1
-
getServiceUrl
public String getServiceUrl()
-
setServiceUrl
public void setServiceUrl(String serviceUrl)
The Pulsar Service URL to point while creating the client from URI
-
getAuthenticationClass
public String getAuthenticationClass()
-
setAuthenticationClass
public void setAuthenticationClass(String authenticationClass)
The Authentication FQCN to be used while creating the client from URI
-
getAuthenticationParams
public String getAuthenticationParams()
-
setAuthenticationParams
public void setAuthenticationParams(String authenticationParams)
The Authentication Parameters to be used while creating the client from URI
-
-