Skip to content

Conversation

garyrussell
Copy link
Contributor

Resolves #1916

Previously, the topics property was used during reply topic configuration
before it had been resolved for SpEL expressions and Property Placeholders.

cherry-pick to 2.7.x

Resolves spring-projects#1916

Previously, the `topics` property was used during reply topic configuration
before it had been resolved for SpEL expressions and Property Placeholders.

**cherry-pick to 2.7.x**
@garyrussell
Copy link
Contributor Author

cc/ @tomazfernandes

Resolves spring-projects#1919

When looking for a retry configuration instance, matches only worked
when `topics` is provided, not `topicPartition`.

If there is no content in the `topics` property, pull the topic names from
`topicPartition`s (if any).
@artembilan artembilan merged commit 7aadccb into spring-projects:main Aug 30, 2021
@artembilan
Copy link
Member

... and back-ported to 2.7.x after fixing small conflict in the KafkaListenerAnnotationBeanPostProcessor and squashing commits.

@garyrussell garyrussell deleted the GH-1916 branch August 30, 2021 17:55
@hariraogotit
Copy link

hariraogotit commented Mar 21, 2023

@garyrussell - includeTopics turns off the retry and falls back to the default. Here is my config. When I comment out includeTopics, it works okay i.e non-blocking retry logic kicks in. Kindly let me know what I missed here? I am using kafka 3.1.2

@Bean
 public RetryTopicConfiguration myRetryTopic(KafkaTemplate<String, byte[]> kafkaTemplate) {
   return RetryTopicConfigurationBuilder
           .newInstance()
           .includeTopics(List.of("request-topic"))
           .exponentialBackoff(3000, 2, 100000)
           .maxAttempts(5)
           .retryTopicSuffix("-asl-nm.retry")
           .dltSuffix("-asl-nm.dlt")
           .create(kafkaTemplate);
 }

@garyrussell
Copy link
Contributor Author

I am not sure why you commented here; this problem has no relation to the subject of this pull request.

includeTopics is used to restrict retryable topics to those in the provided list; when omitted, all topics become retryable. If that is not working as expected; start a discussion (see the tab above) and include much more information, including the listener itself.

@hariraogotit
Copy link

hariraogotit commented Mar 21, 2023

Thanks for the quick response. I was about to comment in #1916 but will start a discussion as you suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RetryTopicConfigurationBuilder#includeTopic does not work with SPEL topics
3 participants