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
Copy file name to clipboardExpand all lines: spring-kafka-docs/src/main/asciidoc/retrytopic.adoc
+10-7Lines changed: 10 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -274,6 +274,7 @@ public RetryTopicConfiguration myRetryTopic(KafkaTemplate<String, MyPojo> templa
274
274
275
275
NOTE: The default is having no timeout set, which can also be achieved by providing -1 as the timout value.
276
276
277
+
[[retry-topic-ex-classifier]]
277
278
===== Exception Classifier
278
279
279
280
You can specify which exceptions you want to retry on and which not to.
@@ -307,8 +308,8 @@ public RetryTopicConfiguration myRetryTopic(KafkaTemplate<String, MyOtherPojo> t
307
308
NOTE: The default behavior is retrying on all exceptions and not traversing causes.
308
309
309
310
Since 2.8.3 there's a global list of fatal exceptions which will cause the record to be sent to the DLT without any retries.
310
-
See <<default-eh, DefaultErrorHandler>> for the default list of fatal exceptions.
311
-
You can add or remove exceptions with:
311
+
See <<default-eh>> for the default list of fatal exceptions.
312
+
You can add or remove exceptions to and from this list with:
312
313
313
314
====
314
315
[source, java]
@@ -642,10 +643,10 @@ public RetryTopicConfiguration myRetryTopic(KafkaTemplate<Integer, MyPojo> templ
642
643
643
644
NOTE: The default behavior is to `ALWAYS_RETRY_ON_ERROR`.
644
645
645
-
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,
646
+
IMPORTANT: Starting with version 2.8.3, `ALWAYS_RETRY_ON_ERROR` will NOT route a record back to the DLT if the record causes a fatal exception to be thrown,
646
647
such as a `DeserializationException` because, generally, such exceptions will always be thrown.
647
648
648
-
Exceptions that are considered fatal are
649
+
Exceptions that are considered fatal are:
649
650
650
651
* `DeserializationException`
651
652
* `MessageConversionException`
@@ -654,7 +655,10 @@ Exceptions that are considered fatal are
654
655
* `NoSuchMethodException`
655
656
* `ClassCastException`
656
657
657
-
You can add exceptions to and remove exceptions from this list using methods on the `DeadLetterPublishingRecovererFactory` bean.
658
+
You can add exceptions to and remove exceptions from this list using methods on the `DestinationTopicResolver` bean.
659
+
660
+
See <<retry-topic-ex-classifier>> for more information.
661
+
658
662
659
663
===== Configuring No DLT
660
664
@@ -685,7 +689,7 @@ public RetryTopicConfiguration myRetryTopic(KafkaTemplate<Integer, MyPojo> templ
685
689
----
686
690
====
687
691
688
-
692
+
[[retry-topic-lcf]]
689
693
==== Specifying a ListenerContainerFactory
690
694
691
695
By default the RetryTopic configuration will use the provided factory from the `@KafkaListener` annotation, but you can specify a different one to be used to create the retry topic and dlt listener containers.
@@ -723,7 +727,6 @@ public RetryTopicConfiguration myOtherRetryTopic(KafkaTemplate<Integer, MyPojo>
723
727
----
724
728
====
725
729
726
-
727
730
IMPORTANT: Since 2.8.3 you can use the same factory for retryable and non-retryable topics.
728
731
729
732
If you need to revert the factory configuration behavior to prior 2.8.3, you can replace the standard `RetryTopicConfigurer` bean and set `useLegacyFactoryConfigurer` to `true`, such as:
0 commit comments