From 65fb8a258dad5180dced64773263271b41f216b9 Mon Sep 17 00:00:00 2001 From: Sorin Jucovschi Date: Wed, 21 Dec 2022 18:12:55 +0200 Subject: [PATCH 1/2] Fixes GH-2516 --- spring-kafka-docs/src/main/asciidoc/retrytopic.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-kafka-docs/src/main/asciidoc/retrytopic.adoc b/spring-kafka-docs/src/main/asciidoc/retrytopic.adoc index 57fbef6f07..7dfcb0c4eb 100644 --- a/spring-kafka-docs/src/main/asciidoc/retrytopic.adoc +++ b/spring-kafka-docs/src/main/asciidoc/retrytopic.adoc @@ -917,7 +917,7 @@ public void processMessage(MyPojo message) { public RetryTopicConfiguration myRetryTopic(KafkaTemplate template) { return RetryTopicConfigurationBuilder .newInstance() - .dltProcessor(MyCustomDltProcessor.class, "processDltMessage") + .dltHandlerMethod("dltProcessorBean", "processDltMessage") .doNotRetryOnDltFailure() .create(template); } From 2db221bdbce83b54eb919b1f7542af9a28f7506d Mon Sep 17 00:00:00 2001 From: Sorin Jucovschi Date: Mon, 23 Jan 2023 16:32:47 +0200 Subject: [PATCH 2/2] Fixes GH-2516 --- spring-kafka-docs/src/main/asciidoc/retrytopic.adoc | 6 +++--- .../kafka/retrytopic/RetryTopicConfigurer.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-kafka-docs/src/main/asciidoc/retrytopic.adoc b/spring-kafka-docs/src/main/asciidoc/retrytopic.adoc index 52c81f82b3..46f18707a5 100644 --- a/spring-kafka-docs/src/main/asciidoc/retrytopic.adoc +++ b/spring-kafka-docs/src/main/asciidoc/retrytopic.adoc @@ -840,7 +840,7 @@ The framework provides a few strategies for working with DLTs. You can provide a ===== Dlt Processing Method -You can specify the method used to process the Dlt for the topic, as well as the behavior if that processing fails. +You can specify the method used to process the DLT for the topic, as well as the behavior if that processing fails. To do that you can use the `@DltHandler` annotation in a method of the class with the `@RetryableTopic` annotation(s). Note that the same method will be used for all the `@RetryableTopic` annotated methods within that class. @@ -870,7 +870,7 @@ The DLT handler method can also be provided through the RetryTopicConfigurationB public RetryTopicConfiguration myRetryTopic(KafkaTemplate template) { return RetryTopicConfigurationBuilder .newInstance() - .dltProcessor("myCustomDltProcessor", "processDltMessage") + .dltHandlerMethod("myCustomDltProcessor", "processDltMessage") .create(template); } @@ -923,7 +923,7 @@ public void processMessage(MyPojo message) { public RetryTopicConfiguration myRetryTopic(KafkaTemplate template) { return RetryTopicConfigurationBuilder .newInstance() - .dltHandlerMethod("dltProcessorBean", "processDltMessage") + .dltHandlerMethod("myCustomDltProcessor", "processDltMessage") .doNotRetryOnDltFailure() .create(template); } diff --git a/spring-kafka/src/main/java/org/springframework/kafka/retrytopic/RetryTopicConfigurer.java b/spring-kafka/src/main/java/org/springframework/kafka/retrytopic/RetryTopicConfigurer.java index 07a7a48e2c..c2da63aee4 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/retrytopic/RetryTopicConfigurer.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/retrytopic/RetryTopicConfigurer.java @@ -178,7 +178,7 @@ * public RetryTopicConfiguration otherRetryTopic(KafkaTemplate<Integer, MyPojo> template) { * return RetryTopicConfigurationBuilder * .newInstance() - * .dltProcessor(MyCustomDltProcessor.class, "processDltMessage") + * .dltHandlerMethod("myCustomDltProcessor", "processDltMessage") * .create(template); * } *