From e2a39cd580da82319340e40af5b3e9ee83eb5f01 Mon Sep 17 00:00:00 2001 From: Alexis SEGURA Date: Mon, 14 Apr 2025 17:41:13 +0200 Subject: [PATCH] GH-3693: Remove outdated DLT Topic Suffix references from Javadoc, reference doc and code sample. (#3831) Fixes: #3693 Issue link: https://github.com/spring-projects/spring-kafka/issues/3693 **Auto-cherry-pick to `3.3.x`** Signed-off-by: Alexis SEGURA Co-authored-by: Alexis SEGURA --- samples/sample-01/src/main/java/com/example/Application.java | 4 ++-- .../modules/ROOT/pages/kafka/annotation-error-handling.adoc | 2 +- .../kafka/listener/DeadLetterPublishingRecoverer.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/sample-01/src/main/java/com/example/Application.java b/samples/sample-01/src/main/java/com/example/Application.java index ef5cf8c6..9ba78591 100644 --- a/samples/sample-01/src/main/java/com/example/Application.java +++ b/samples/sample-01/src/main/java/com/example/Application.java @@ -79,7 +79,7 @@ public class Application { this.exec.execute(() -> System.out.println("Hit Enter to terminate...")); } - @KafkaListener(id = "dltGroup", topics = "topic1.DLT") + @KafkaListener(id = "dltGroup", topics = "topic1-dlt") public void dltListen(byte[] in) { logger.info("Received from DLT: " + new String(in)); this.exec.execute(() -> System.out.println("Hit Enter to terminate...")); @@ -92,7 +92,7 @@ public class Application { @Bean public NewTopic dlt() { - return new NewTopic("topic1.DLT", 1, (short) 1); + return new NewTopic("topic1-dlt", 1, (short) 1); } @Bean diff --git a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/annotation-error-handling.adoc b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/annotation-error-handling.adoc index 777f4658..c6feb793 100644 --- a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/annotation-error-handling.adoc +++ b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/annotation-error-handling.adoc @@ -743,7 +743,7 @@ public ErrorHandler eh(KafkaOperations template) { retries.value()[0]++; } return retries.value()[0] > 5 - ? new TopicPartition("topic.DLT", rec.partition()) + ? new TopicPartition("topic-dlt", rec.partition()) : new TopicPartition("topic", rec.partition()); }), new FixedBackOff(0L, 0L)); } diff --git a/spring-kafka/src/main/java/org/springframework/kafka/listener/DeadLetterPublishingRecoverer.java b/spring-kafka/src/main/java/org/springframework/kafka/listener/DeadLetterPublishingRecoverer.java index f0583b09..dc5a9c0f 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/listener/DeadLetterPublishingRecoverer.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/listener/DeadLetterPublishingRecoverer.java @@ -140,7 +140,7 @@ public class DeadLetterPublishingRecoverer extends ExceptionClassifier implement /** * Create an instance with the provided template and a default destination resolving - * function that returns a TopicPartition based on the original topic (appended with ".DLT") + * function that returns a TopicPartition based on the original topic (appended with "-dlt") * from the failed record, and the same partition as the failed record. Therefore the * dead-letter topic must have at least as many partitions as the original topic. * @param template the {@link KafkaOperations} to use for publishing. @@ -165,7 +165,7 @@ public class DeadLetterPublishingRecoverer extends ExceptionClassifier implement /** * Create an instance with the provided templates and a default destination resolving * function that returns a TopicPartition based on the original topic (appended with - * ".DLT") from the failed record, and the same partition as the failed record. + * "-dlt") from the failed record, and the same partition as the failed record. * Therefore the dead-letter topic must have at least as many partitions as the * original topic. The templates map keys are classes and the value the corresponding * template to use for objects (producer record values) of that type. A