Class PulsarConfiguration
java.lang.Object
org.apache.camel.component.pulsar.PulsarConfiguration
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Returns a copy of this configurationlong
long
org.apache.pulsar.client.api.RedeliveryBackoff
org.apache.pulsar.client.api.BatcherBuilder
int
long
org.apache.pulsar.client.api.CompressionType
int
long
int
int
Deprecated.org.apache.pulsar.client.api.MessageRouter
Set a custom Message Router.org.apache.pulsar.client.api.MessageRoutingMode
Set the message routing mode for the producer.org.apache.pulsar.client.api.RedeliveryBackoff
long
int
int
int
org.apache.pulsar.client.api.RegexSubscriptionMode
boolean
boolean
boolean
boolean
boolean
boolean
boolean
Enable compacted topic reading.boolean
void
setAckGroupTimeMillis
(long ackGroupTimeMillis) Group the consumer acknowledgments for the specified time in milliseconds - defaults to 100void
setAckTimeoutMillis
(long ackTimeoutMillis) Timeout for unacknowledged messages in milliseconds - defaults to 10000void
setAckTimeoutRedeliveryBackoff
(org.apache.pulsar.client.api.RedeliveryBackoff redeliveryBackoff) Set a RedeliveryBackoff to use for ack timeout redelivery backoff.void
setAllowManualAcknowledgement
(boolean allowManualAcknowledgement) Whether to allow manual message acknowledgements.void
setAuthenticationClass
(String authenticationClass) The Authentication FQCN to be used while creating the client from URIvoid
setAuthenticationParams
(String authenticationParams) The Authentication Parameters to be used while creating the client from URIvoid
setBatcherBuilder
(org.apache.pulsar.client.api.BatcherBuilder batcherBuilder) Control batching method of the Pulsar producer.void
setBatchingEnabled
(boolean batchingEnabled) Control whether automatic batching of messages is enabled for the producer.void
setBatchingMaxMessages
(int batchingMaxMessages) Set the maximum number of messages permitted in a batch.void
setBatchingMaxPublishDelayMicros
(long batchingMaxPublishDelayMicros) Set the time period within which the messages sent will be batched if batch messages are enabled.void
setBlockIfQueueFull
(boolean blockIfQueueFull) Set whether the send and asyncSend operations should block when the outgoing message queue is full.void
setChunkingEnabled
(boolean chunkingEnabled) Control whether chunking of messages is enabled for the producer.void
setCompressionType
(String compressionType) Set the compression type for the producer.void
setCompressionType
(org.apache.pulsar.client.api.CompressionType compressionType) Set the compression type for the producer.void
setConsumerName
(String consumerName) Name of the consumer when subscription is EXCLUSIVEvoid
setConsumerNamePrefix
(String consumerNamePrefix) Prefix to add to consumer names when a SHARED or FAILOVER subscription is usedvoid
setConsumerQueueSize
(int consumerQueueSize) Size of the consumer queue - defaults to 10void
setDeadLetterTopic
(String deadLetterTopic) void
setEnableRetry
(boolean enableRetry) void
setHashingScheme
(String hashingScheme) Hashing function to use when choosing the partition to use for a particular messagevoid
setInitialSequenceId
(long initialSequenceId) Set the baseline for the sequence ids for messages published by the producer.void
setKeySharedPolicy
(String keySharedPolicy) void
setMaxPendingMessages
(int maxPendingMessages) Set the max size of the queue holding the messages pending to receive an acknowledgment from the broker.void
setMaxPendingMessagesAcrossPartitions
(int maxPendingMessagesAcrossPartitions) Deprecated.void
setMaxRedeliverCount
(Integer maxRedeliverCount) void
setMessageListener
(boolean messageListener) void
setMessageRouter
(org.apache.pulsar.client.api.MessageRouter messageRouter) void
setMessageRoutingMode
(org.apache.pulsar.client.api.MessageRoutingMode messageRoutingMode) void
setNegativeAckRedeliveryBackoff
(org.apache.pulsar.client.api.RedeliveryBackoff redeliveryBackoff) Set a RedeliveryBackoff to use for negative ack redelivery backoff.void
setNegativeAckRedeliveryDelayMicros
(long negativeAckRedeliveryDelayMicros) Set the negative acknowledgement delayvoid
setNumberOfConsumers
(int numberOfConsumers) Number of consumers - defaults to 1void
setNumberOfConsumerThreads
(int numberOfConsumerThreads) Number of consumers threads - defaults to 1void
setProducerName
(String producerName) Name of the producer.void
setReadCompacted
(boolean readCompacted) void
setRetryLetterTopic
(String retryLetterTopic) void
setSendTimeoutMs
(int sendTimeoutMs) Send timeout in milliseconds.void
setServiceUrl
(String serviceUrl) The Pulsar Service URL to point while creating the client from URIvoid
setSubscriptionInitialPosition
(SubscriptionInitialPosition subscriptionInitialPosition) Control the initial position in the topic of a newly created subscription.void
setSubscriptionName
(String subscriptionName) Name of the subscription to usevoid
setSubscriptionTopicsMode
(org.apache.pulsar.client.api.RegexSubscriptionMode subscriptionTopicsMode) Determines to which topics this consumer should be subscribed to - Persistent, Non-Persistent, or both.void
setSubscriptionType
(SubscriptionType subscriptionType) Type of the subscription [EXCLUSIVE|SHARED|FAILOVER|KEY_SHARED], defaults to EXCLUSIVEvoid
setTopicsPattern
(boolean topicsPattern) Whether the topic is a pattern (regular expression) that allows the consumer to subscribe to all matching topics in the namespace
-
Constructor Details
-
PulsarConfiguration
public PulsarConfiguration()
-
-
Method Details
-
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
-
setSubscriptionName
Name of the subscription to use -
getSubscriptionType
-
setSubscriptionType
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
-
setConsumerName
Name of the consumer when subscription is EXCLUSIVE -
getProducerName
-
setProducerName
Name of the producer. If unset, lets Pulsar select a unique identifier. -
getConsumerNamePrefix
-
setConsumerNamePrefix
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 ofPulsarMessageReceipt
is stored as a header on theExchange
. Messages can then be acknowledged usingPulsarMessageReceipt
at 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. -
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
Control the initial position in the topic of a newly created subscription. Default is latest message. -
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
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() -
setChunkingEnabled
public void setChunkingEnabled(boolean chunkingEnabled) Control whether chunking of messages is enabled for the producer. Default is false. -
isChunkingEnabled
public boolean isChunkingEnabled() -
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
-
setMaxRedeliverCount
-
getDeadLetterTopic
-
setDeadLetterTopic
-
isEnableRetry
public boolean isEnableRetry() -
setEnableRetry
public void setEnableRetry(boolean enableRetry) -
getRetryLetterTopic
-
setRetryLetterTopic
-
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
-
setServiceUrl
The Pulsar Service URL to point while creating the client from URI -
getAuthenticationClass
-
setAuthenticationClass
The Authentication FQCN to be used while creating the client from URI -
getAuthenticationParams
-
setAuthenticationParams
The Authentication Parameters to be used while creating the client from URI -
getHashingScheme
-
setHashingScheme
Hashing function to use when choosing the partition to use for a particular message
-