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
Before we hardcoded a no-ops back off in the DefaultErrorHandler used in the Retryable Topics feature.
Adds a setter to let the user provide their own back off policy and configure blocking retries in conjunction with RT.
Copy file name to clipboardExpand all lines: spring-kafka-docs/src/main/asciidoc/retrytopic.adoc
+32Lines changed: 32 additions & 0 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-exception-classifier]]
277
278
===== Exception Classifier
278
279
279
280
You can specify which exceptions you want to retry on and which not to.
@@ -328,6 +329,37 @@ public DefaultDestinationTopicResolver topicResolver(ApplicationContext applicat
328
329
NOTE: To disable fatal exceptions' classification, clear the default list using the `setClassifications` method in `DefaultDestinationTopicResolver`.
329
330
330
331
332
+
[[retry-topic-combine-blocking]]
333
+
===== Combine blocking and non-blocking retries
334
+
335
+
Starting in 2.8.3 you can configure the framework to use both blocking and non-blocking retries in conjunction.
336
+
For example, you can have a set of exceptions that would likely trigger errors on the next records as well, such as `DatabaseAccessException`, so you can retry the same record a few times before sending it to the retry topic, or straight to the DLT.
337
+
338
+
You can configure the blocking retries as follows:
NOTE: If you set a blocking retry back off, the default is to retry on all exceptions except the fatal ones in <<default-eh>>.
358
+
You can add or remove exceptions using the `addNotRetryableException` and `removeNotRetryableException` methods in the `ListenerContainerFactoryConfigurer`.
359
+
360
+
NOTE: In combination with the global retryable topic's fatal classification, you can configure the framework for any behavior you'd like, such as having some exceptions trigger both blocking and non-blocking retries, trigger only one kind or the other, or go straight to the DLT without retries of any kind.
361
+
362
+
331
363
===== Include and Exclude Topics
332
364
333
365
You can decide which topics will and will not be handled by a `RetryTopicConfiguration` bean via the .includeTopic(String topic), .includeTopics(Collection<String> topics) .excludeTopic(String topic) and .excludeTopics(Collection<String> topics) methods.
Copy file name to clipboardExpand all lines: spring-kafka/src/test/java/org/springframework/kafka/retrytopic/ListenerContainerFactoryConfigurerTests.java
0 commit comments