Class PulsarContainerProperties
java.lang.Object
org.springframework.pulsar.listener.PulsarContainerProperties
Contains runtime properties for a listener container.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTransaction related settings. -
Constructor Summary
ConstructorsConstructorDescriptionPulsarContainerProperties(String topicPattern) PulsarContainerProperties(String... topics) -
Method Summary
Modifier and TypeMethodDescriptionintintorg.springframework.core.task.AsyncTaskExecutororg.springframework.retry.support.RetryTemplateGet the default template to use to retry startup when no custom retry template has been specified.intintio.micrometer.observation.ObservationRegistryorg.apache.pulsar.client.api.Schema<?>org.apache.pulsar.common.schema.SchemaTypeorg.springframework.retry.support.RetryTemplateorg.apache.pulsar.client.api.SubscriptionTypebooleanbooleanvoidsetAckMode(AckMode ackMode) voidsetBatchListener(boolean batchListener) voidsetBatchTimeoutMillis(int batchTimeoutMillis) voidsetConcurrency(int concurrency) voidsetConsumerStartTimeout(Duration consumerStartTimeout) Set the max duration to wait for the consumer thread to start before logging an error.voidsetConsumerTaskExecutor(org.springframework.core.task.AsyncTaskExecutor consumerExecutor) voidsetMaxNumBytes(int maxNumBytes) voidsetMaxNumMessages(int maxNumMessages) voidsetMessageListener(Object messageListener) voidsetObservationEnabled(boolean observationEnabled) voidsetPulsarConsumerProperties(Properties pulsarConsumerProperties) voidsetSchema(org.apache.pulsar.client.api.Schema<?> schema) voidsetSchemaResolver(SchemaResolver schemaResolver) voidsetSchemaType(org.apache.pulsar.common.schema.SchemaType schemaType) voidsetStartupFailurePolicy(StartupFailurePolicy startupFailurePolicy) The action to take on the container when a failure occurs during startup.voidsetStartupFailureRetryTemplate(org.springframework.retry.support.RetryTemplate startupFailureRetryTemplate) Set the template to use to retry startup when an exception occurs during startup.voidsetSubscriptionName(String subscriptionName) voidsetSubscriptionType(org.apache.pulsar.client.api.SubscriptionType subscriptionType) voidsetTopicResolver(TopicResolver topicResolver) voidvoidsetTopicsPattern(String topicsPattern) Gets the transaction settings for the listener container.void
-
Constructor Details
-
PulsarContainerProperties
-
PulsarContainerProperties
-
-
Method Details
-
getMessageListener
-
setMessageListener
-
getConsumerTaskExecutor
public org.springframework.core.task.AsyncTaskExecutor getConsumerTaskExecutor() -
setConsumerTaskExecutor
public void setConsumerTaskExecutor(org.springframework.core.task.AsyncTaskExecutor consumerExecutor) -
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
@Nullable public org.springframework.retry.support.RetryTemplate 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()
-