Reputation: 858
I'm testing the new feature in Spring Kafka 2.7 for non-blocking retries. I have a fixed retry-topic that is already given and named after a certain scheme prescribed by my company, and no DLT topic. I want to configure a retry policy with a fixed backoff policy, no DLT, but with my single retry-topic. I couldn't find a way to configure this with RetryTopicConfiguration
. In RetryTopicConfiguration
, the name of the retry-topic is constructed by appending a suffix (depending on the TopicSuffixingStrategy
) to the main topic name. Is there a way to set the retry-topic directly?
Upvotes: 0
Views: 1367
Reputation: 174554
See the documentation.
Custom naming strategies
More complex naming strategies can be accomplished by registering a bean that implements
RetryTopicNamesProviderFactory
. The default implementation isSuffixingRetryTopicNamesProviderFactory
and a different implementation can be registered in the following way:
@Bean
public RetryTopicNamesProviderFactory myRetryNamingProviderFactory() {
return new CustomRetryTopicNamesProviderFactory();
}
Upvotes: 1