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.
@@ -306,6 +307,37 @@ public RetryTopicConfiguration myRetryTopic(KafkaTemplate<String, MyOtherPojo> t
306
307
307
308
NOTE: The default behavior is retrying on all exceptions and not traversing causes.
308
309
310
+
[[retry-topic-combine-blocking]]
311
+
===== Combine blocking and non-blocking retries
312
+
313
+
Starting in 2.8.3 you can configure the framework to use both blocking and non-blocking retries in conjunction.
314
+
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.
315
+
316
+
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>>.
336
+
You can add or remove exceptions using the `addNotRetryableException` and `removeNotRetryableException` methods in the `ListenerContainerFactoryConfigurer`.
337
+
338
+
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.
339
+
340
+
309
341
===== Include and Exclude Topics
310
342
311
343
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