You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resolves#1918
Do not publish records with fatal exceptions to the same topic, it
causes an irrecoverable endless loop.
Log at ERROR when such a situation is detected.
Extract a new abstract super class for exception classification.
Copy file name to clipboardExpand all lines: spring-kafka-docs/src/main/asciidoc/retrytopic.adoc
+18-4Lines changed: 18 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -532,11 +532,11 @@ public class MyCustomDltProcessor {
532
532
533
533
NOTE: If no DLT handler is provided, the default RetryTopicConfigurer.LoggingDltListenerHandlerMethod is used.
534
534
535
-
===== Dlt Failure Behavior
535
+
===== DLT Failure Behavior
536
536
537
-
Should the Dlt processing fail, there are two possible behaviors available: `ALWAYS_RETRY_ON_ERROR` and `FAIL_ON_ERROR`.
537
+
Should the DLT processing fail, there are two possible behaviors available: `ALWAYS_RETRY_ON_ERROR` and `FAIL_ON_ERROR`.
538
538
539
-
In the former the message is forwarded back to the dlt topic so it doesn't block other dlt messages' processing.
539
+
In the former the record is forwarded back to the DLT topic so it doesn't block other DLT records' processing.
540
540
In the latter the consumer ends the execution without forwarding the message.
541
541
542
542
====
@@ -566,7 +566,21 @@ public RetryTopicConfiguration myRetryTopic(KafkaTemplate<Integer, MyPojo> templ
566
566
567
567
NOTE: The default behavior is to `ALWAYS_RETRY_ON_ERROR`.
568
568
569
-
===== Configuring No Dlt
569
+
IMPORTANT: Starting with version 2.8, `ALWAYS_RETRY_ON_ERROR` will NOT route a record back to the DLT if the record causes a fatal exception to be thrown,
570
+
such as a `DeserializationException` because, generally, such exceptions will always be thrown.
571
+
572
+
Exceptions that are considered fatal are
573
+
574
+
* `DeserializationException`
575
+
* `MessageConversionException`
576
+
* `ConversionException`
577
+
* `MethodArgumentResolutionException`
578
+
* `NoSuchMethodException`
579
+
* `ClassCastException`
580
+
581
+
You can add exceptions to and remove exceptions from this list using methods on the `DeadLetterPublishingRecovererFactory` bean.
582
+
583
+
===== Configuring No DLT
570
584
571
585
The framework also provides the possibility of not configuring a DLT for the topic.
572
586
In this case after retrials are exhausted the processing simply ends.
0 commit comments