Class RetryTopicConfigurationProvider

java.lang.Object
org.springframework.kafka.annotation.RetryTopicConfigurationProvider

public class RetryTopicConfigurationProvider extends Object
Attempts to provide an instance of RetryTopicConfiguration by either creating one from a RetryableTopic annotation, or from the bean container if no annotation is available.

If beans are found in the container there's a check to determine whether or not the provided topics should be handled by any of such instances.

If the annotation is provided, a DltHandler annotated method is looked up.

Since:
2.7
Author:
Tomaz Fernandes, Gary Russell, Wang Zhiyang
See Also:
  • Constructor Details

    • RetryTopicConfigurationProvider

      public RetryTopicConfigurationProvider(@Nullable BeanFactory beanFactory)
      Construct an instance using the provided bean factory and default resolver and bean expression context.
      Parameters:
      beanFactory - the bean factory.
    • RetryTopicConfigurationProvider

      public RetryTopicConfigurationProvider(@Nullable BeanFactory beanFactory, @Nullable BeanExpressionResolver resolver, @Nullable BeanExpressionContext expressionContext)
      Construct an instance using the provided parameters.
      Parameters:
      beanFactory - the bean factory.
      resolver - the bean expression resolver.
      expressionContext - the bean expression context.
  • Method Details

    • findRetryConfigurationFor

      public @Nullable RetryTopicConfiguration findRetryConfigurationFor(String[] topics, Method method, Object bean)
    • findRetryConfigurationFor

      public @Nullable RetryTopicConfiguration findRetryConfigurationFor(String[] topics, @Nullable Method method, @Nullable Class<?> clazz, Object bean)
      Find retry topic configuration.
      Parameters:
      topics - the retryable topic list.
      method - the method that gets @RetryableTopic annotation.
      clazz - the class that gets @RetryableTopic annotation.
      bean - the bean.
      Returns:
      the retry topic configuration.