Class PulsarContainerProperties
java.lang.Object
org.springframework.pulsar.listener.PulsarContainerProperties
Contains runtime properties for a listener container.
- Author:
- Soby Chacko, Alexander Preuß, Chris Bono, Vedran Pavic
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Transaction related settings. -
Constructor Summary
ConstructorsConstructorDescriptionPulsarContainerProperties
(String topicPattern) PulsarContainerProperties
(String... topics) -
Method Summary
Modifier and TypeMethodDescriptionint
int
org.springframework.retry.support.RetryTemplate
Get the default template to use to retry startup when no custom retry template has been specified.int
int
io.micrometer.observation.ObservationRegistry
org.apache.pulsar.client.api.Schema<?>
org.apache.pulsar.common.schema.SchemaType
org.springframework.retry.support.RetryTemplate
org.apache.pulsar.client.api.SubscriptionType
boolean
boolean
void
setAckMode
(AckMode ackMode) void
setBatchListener
(boolean batchListener) void
setBatchTimeoutMillis
(int batchTimeoutMillis) void
setConcurrency
(int concurrency) void
setConsumerStartTimeout
(Duration consumerStartTimeout) Set the max duration to wait for the consumer thread to start before logging an error.void
setConsumerTaskExecutor
(AsyncTaskExecutor consumerExecutor) void
setMaxNumBytes
(int maxNumBytes) void
setMaxNumMessages
(int maxNumMessages) void
setMessageListener
(Object messageListener) void
setObservationEnabled
(boolean observationEnabled) void
setPulsarConsumerProperties
(Properties pulsarConsumerProperties) void
setSchema
(org.apache.pulsar.client.api.Schema<?> schema) void
setSchemaResolver
(SchemaResolver schemaResolver) void
setSchemaType
(org.apache.pulsar.common.schema.SchemaType schemaType) void
setStartupFailurePolicy
(StartupFailurePolicy startupFailurePolicy) The action to take on the container when a failure occurs during startup.void
setStartupFailureRetryTemplate
(org.springframework.retry.support.RetryTemplate startupFailureRetryTemplate) Set the template to use to retry startup when an exception occurs during startup.void
setSubscriptionName
(String subscriptionName) void
setSubscriptionType
(org.apache.pulsar.client.api.SubscriptionType subscriptionType) void
setTopicResolver
(TopicResolver topicResolver) void
void
setTopicsPattern
(String topicsPattern) Gets the transaction settings for the listener container.void
-
Constructor Details
-
PulsarContainerProperties
-
PulsarContainerProperties
-
-
Method Details
-
getMessageListener
-
setMessageListener
-
getConsumerTaskExecutor
-
setConsumerTaskExecutor
-
getConcurrency
public int getConcurrency() -
setConcurrency
public void setConcurrency(int concurrency) -
getSubscriptionType
public org.apache.pulsar.client.api.SubscriptionType getSubscriptionType() -
setSubscriptionType
public void setSubscriptionType(org.apache.pulsar.client.api.SubscriptionType subscriptionType) -
getMaxNumMessages
public int getMaxNumMessages() -
setMaxNumMessages
public void setMaxNumMessages(int maxNumMessages) -
getMaxNumBytes
public int getMaxNumBytes() -
setMaxNumBytes
public void setMaxNumBytes(int maxNumBytes) -
getBatchTimeoutMillis
public int getBatchTimeoutMillis() -
setBatchTimeoutMillis
public void setBatchTimeoutMillis(int batchTimeoutMillis) -
isBatchListener
public boolean isBatchListener() -
setBatchListener
public void setBatchListener(boolean batchListener) -
getAckMode
-
setAckMode
-
isObservationEnabled
public boolean isObservationEnabled() -
setObservationEnabled
public void setObservationEnabled(boolean observationEnabled) -
getObservationRegistry
public io.micrometer.observation.ObservationRegistry getObservationRegistry() -
getObservationConvention
-
getConsumerStartTimeout
-
setConsumerStartTimeout
Set the max duration to wait for the consumer thread to start before logging an error. The default is 30 seconds.- Parameters:
consumerStartTimeout
- the consumer start timeout
-
getTopics
-
setTopics
-
getTopicsPattern
-
setTopicsPattern
-
getSubscriptionName
-
setSubscriptionName
-
getSchema
public org.apache.pulsar.client.api.Schema<?> getSchema() -
setSchema
public void setSchema(org.apache.pulsar.client.api.Schema<?> schema) -
getSchemaType
public org.apache.pulsar.common.schema.SchemaType getSchemaType() -
setSchemaType
public void setSchemaType(org.apache.pulsar.common.schema.SchemaType schemaType) -
getSchemaResolver
-
setSchemaResolver
-
getTopicResolver
-
setTopicResolver
-
getPulsarConsumerProperties
-
setPulsarConsumerProperties
-
transactions
Gets the transaction settings for the listener container.- Returns:
- the transaction settings
- Since:
- 1.1.0
-
getStartupFailureRetryTemplate
-
getDefaultStartupFailureRetryTemplate
public org.springframework.retry.support.RetryTemplate getDefaultStartupFailureRetryTemplate()Get the default template to use to retry startup when no custom retry template has been specified.- Returns:
- the default retry template that will retry 3 times with a fixed delay of 10 seconds between each attempt.
- Since:
- 1.2.0
-
setStartupFailureRetryTemplate
public void setStartupFailureRetryTemplate(org.springframework.retry.support.RetryTemplate startupFailureRetryTemplate) Set the template to use to retry startup when an exception occurs during startup.- Parameters:
startupFailureRetryTemplate
- the retry template to use- Since:
- 1.2.0
-
getStartupFailurePolicy
-
setStartupFailurePolicy
The action to take on the container when a failure occurs during startup.- Parameters:
startupFailurePolicy
- action to take when a failure occurs during startup- Since:
- 1.2.0
-
updateContainerProperties
public void updateContainerProperties()
-