Class RetryTopicComponentFactory
java.lang.Object
org.springframework.kafka.retrytopic.RetryTopicComponentFactory
Provide the component instances that will be used with
RetryTopicConfigurationSupport. Override any of the methods to provide
a different implementation or subclass, then override the
RetryTopicConfigurationSupport.createComponentFactory() method
to return this factory's subclass.- Since:
- 2.9
- Author:
- Tomaz Fernandes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ClockCreate aClockinstance that will be used for all time-related operations in the retry topic processes.deadLetterPublishingRecovererFactory(DestinationTopicResolver destinationTopicResolver) Create theDeadLetterPublishingRecovererFactorythat will be used to create theDeadLetterPublishingRecovererto forward the records to a givenDestinationTopic.destinationTopicProcessor(DestinationTopicResolver destinationTopicResolver) Create theDestinationTopicProcessorthat will be used to process theDestinationTopicinstances and store them in the providedDestinationTopicResolver.Create the instance ofDestinationTopicResolverthat will be used to store theDestinationTopicinstance and resolve which a given record should be forwarded to.Return theClockinstance that will be used for all time-related operations in the retry topic processes.kafkaBackOffManagerFactory(ListenerContainerRegistry registry, ApplicationContext applicationContext) Create theKafkaBackOffManagerFactorythat will be used to create theKafkaConsumerBackoffManagerinstance used to back off the partitions.listenerContainerFactoryConfigurer(KafkaConsumerBackoffManager kafkaConsumerBackoffManager, DeadLetterPublishingRecovererFactory deadLetterPublishingRecovererFactory, Clock clock) Create aListenerContainerFactoryConfigurerthat will be used to configure theKafkaListenerContainerFactoryresolved by theListenerContainerFactoryResolver.listenerContainerFactoryResolver(BeanFactory beanFactory) Create theListenerContainerFactoryResolverthat will be used to resolve the appropriateKafkaListenerContainerFactoryfor a given topic.retryTopicConfigurer(DestinationTopicProcessor destinationTopicProcessor, ListenerContainerFactoryConfigurer listenerContainerFactoryConfigurer, ListenerContainerFactoryResolver factoryResolver, RetryTopicNamesProviderFactory retryTopicNamesProviderFactory) Create theRetryTopicConfigurerthat will serve as an entry point for configuring non-blocking topic-based delayed retries for a givenKafkaListenerEndpoint, by processing the appropriateRetryTopicConfiguration.Create theRetryTopicNamesProviderFactoryinstance that will be used to provide the property names for the retry topics'KafkaListenerEndpoint.
-
Constructor Details
-
RetryTopicComponentFactory
public RetryTopicComponentFactory()
-
-
Method Details
-
retryTopicConfigurer
public RetryTopicConfigurer retryTopicConfigurer(DestinationTopicProcessor destinationTopicProcessor, ListenerContainerFactoryConfigurer listenerContainerFactoryConfigurer, ListenerContainerFactoryResolver factoryResolver, RetryTopicNamesProviderFactory retryTopicNamesProviderFactory) Create theRetryTopicConfigurerthat will serve as an entry point for configuring non-blocking topic-based delayed retries for a givenKafkaListenerEndpoint, by processing the appropriateRetryTopicConfiguration.- Parameters:
destinationTopicProcessor- theDestinationTopicProcessorthat will be used to process theDestinationTopicinstances and register them in aDestinationTopicContainer.listenerContainerFactoryConfigurer- theListenerContainerFactoryConfigurerthat will be used to configure theKafkaListenerContainerFactoryinstances for the non-blocking delayed retries feature.factoryResolver- theListenerContainerFactoryResolverthat will be used to resolve the properKafkaListenerContainerFactoryfor a given endpoint or its retry topics.retryTopicNamesProviderFactory- theRetryTopicNamesProviderFactorythat will be used to provide the property names for the retry topics' endpoints.- Returns:
- the instance.
-
destinationTopicProcessor
public DestinationTopicProcessor destinationTopicProcessor(DestinationTopicResolver destinationTopicResolver) Create theDestinationTopicProcessorthat will be used to process theDestinationTopicinstances and store them in the providedDestinationTopicResolver.- Parameters:
destinationTopicResolver- theDestinationTopicResolverinstance to be used to store theDestinationTopicinstances.- Returns:
- the instance.
-
destinationTopicResolver
Create the instance ofDestinationTopicResolverthat will be used to store theDestinationTopicinstance and resolve which a given record should be forwarded to.- Returns:
- the instance.
-
deadLetterPublishingRecovererFactory
public DeadLetterPublishingRecovererFactory deadLetterPublishingRecovererFactory(DestinationTopicResolver destinationTopicResolver) Create theDeadLetterPublishingRecovererFactorythat will be used to create theDeadLetterPublishingRecovererto forward the records to a givenDestinationTopic.- Parameters:
destinationTopicResolver- theDestinationTopicResolverinstance to resolve the destinations.- Returns:
- the instance.
-
listenerContainerFactoryResolver
Create theListenerContainerFactoryResolverthat will be used to resolve the appropriateKafkaListenerContainerFactoryfor a given topic.- Parameters:
beanFactory- theBeanFactorythat will be used to retrieve theKafkaListenerContainerFactoryinstance if necessary.- Returns:
- the instance.
-
listenerContainerFactoryConfigurer
public ListenerContainerFactoryConfigurer listenerContainerFactoryConfigurer(KafkaConsumerBackoffManager kafkaConsumerBackoffManager, DeadLetterPublishingRecovererFactory deadLetterPublishingRecovererFactory, Clock clock) Create aListenerContainerFactoryConfigurerthat will be used to configure theKafkaListenerContainerFactoryresolved by theListenerContainerFactoryResolver.- Parameters:
kafkaConsumerBackoffManager- theKafkaConsumerBackoffManagerused with theKafkaBackoffAwareMessageListenerAdapter.deadLetterPublishingRecovererFactory- the factory that will provide theDeadLetterPublishingRecovererinstance to be used.clock- theClockinstance to be used with the listener adapter.- Returns:
- the instance.
-
retryTopicNamesProviderFactory
Create theRetryTopicNamesProviderFactoryinstance that will be used to provide the property names for the retry topics'KafkaListenerEndpoint.- Returns:
- the instance.
-
kafkaBackOffManagerFactory
public KafkaBackOffManagerFactory kafkaBackOffManagerFactory(@Nullable ListenerContainerRegistry registry, ApplicationContext applicationContext) Create theKafkaBackOffManagerFactorythat will be used to create theKafkaConsumerBackoffManagerinstance used to back off the partitions.- Parameters:
registry- theListenerContainerRegistryused to fetch theMessageListenerContainer.applicationContext- the application context.- Returns:
- the instance.
-
internalRetryTopicClock
-
createInternalRetryTopicClock
-