Class RetryTopicConfigurationBuilder
java.lang.Object
org.springframework.kafka.retrytopic.RetryTopicConfigurationBuilder
Builder class to create
RetryTopicConfiguration
instances.- Since:
- 2.7
- Author:
- Tomaz Fernandes, Gary Russell
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionautoCreateTopics
(boolean shouldCreate, int numPartitions, short replicationFactor) autoCreateTopicsWith
(int numPartitions, short replicationFactor) autoStartDltHandler
(Boolean autoStart) Set to false to not start the DLT handler (configured or default); overrides the container factory's autoStartup property.create
(KafkaOperations<?, ?> sendToTopicKafkaTemplate) customBackoff
(org.springframework.retry.backoff.SleepingBackOffPolicy<?> backOffPolicy) dltHandlerMethod
(String beanName, String methodName) Configure a DLT handler method.dltHandlerMethod
(EndpointHandlerMethod endpointHandlerMethod) dltProcessingFailureStrategy
(DltStrategy dltStrategy) excludeTopic
(String topicName) excludeTopics
(List<String> topicNames) exponentialBackoff
(long initialInterval, double multiplier, long maxInterval) exponentialBackoff
(long initialInterval, double multiplier, long maxInterval, boolean withRandom) fixedBackOff
(int interval) fixedBackOff
(long interval) includeTopic
(String topicName) includeTopics
(List<String> topicNames) listenerFactory
(String factoryBeanName) listenerFactory
(ConcurrentKafkaListenerContainerFactory<?, ?> factory) maxAttempts
(int maxAttempts) Create a new instance of the builder.notRetryOn
(Class<? extends Throwable> throwable) notRetryOn
(List<Class<? extends Throwable>> throwables) retryTopicSuffix
(String suffix) setTopicSuffixingStrategy
(TopicSuffixingStrategy topicSuffixingStrategy) timeoutAfter
(long timeout) traversingCauses
(boolean traversing) uniformRandomBackoff
(long minInterval, long maxInterval) useSingleTopicForFixedDelays
(FixedDelayStrategy useSameTopicForFixedDelays)
-
Constructor Details
-
RetryTopicConfigurationBuilder
public RetryTopicConfigurationBuilder()
-
-
Method Details
-
dltHandlerMethod
Configure a DLT handler method.- Parameters:
beanName
- the bean name.methodName
- the method name.- Returns:
- the builder.
- Since:
- 2.8
-
dltHandlerMethod
-
doNotRetryOnDltFailure
-
dltProcessingFailureStrategy
-
doNotConfigureDlt
-
autoStartDltHandler
Set to false to not start the DLT handler (configured or default); overrides the container factory's autoStartup property.- Parameters:
autoStart
- false to not auto start.- Returns:
- this builder.
- Since:
- 2.8
-
includeTopics
-
excludeTopics
-
includeTopic
-
excludeTopic
-
retryTopicSuffix
-
dltSuffix
-
suffixTopicsWithIndexValues
-
setTopicSuffixingStrategy
public RetryTopicConfigurationBuilder setTopicSuffixingStrategy(TopicSuffixingStrategy topicSuffixingStrategy) -
maxAttempts
-
timeoutAfter
-
exponentialBackoff
public RetryTopicConfigurationBuilder exponentialBackoff(long initialInterval, double multiplier, long maxInterval) -
exponentialBackoff
public RetryTopicConfigurationBuilder exponentialBackoff(long initialInterval, double multiplier, long maxInterval, boolean withRandom) -
fixedBackOff
-
uniformRandomBackoff
-
noBackoff
-
customBackoff
public RetryTopicConfigurationBuilder customBackoff(org.springframework.retry.backoff.SleepingBackOffPolicy<?> backOffPolicy) -
fixedBackOff
-
useSingleTopicForFixedDelays
-
useSingleTopicForFixedDelays
public RetryTopicConfigurationBuilder useSingleTopicForFixedDelays(FixedDelayStrategy useSameTopicForFixedDelays) -
doNotAutoCreateRetryTopics
-
autoCreateTopicsWith
public RetryTopicConfigurationBuilder autoCreateTopicsWith(int numPartitions, short replicationFactor) -
autoCreateTopics
public RetryTopicConfigurationBuilder autoCreateTopics(boolean shouldCreate, int numPartitions, short replicationFactor) -
retryOn
-
notRetryOn
-
retryOn
-
notRetryOn
-
traversingCauses
-
traversingCauses
-
listenerFactory
public RetryTopicConfigurationBuilder listenerFactory(ConcurrentKafkaListenerContainerFactory<?, ?> factory) -
listenerFactory
-
create
-
newInstance
Create a new instance of the builder.- Returns:
- the new instance.
-