Skip to content

Commit

Permalink
Add what's new and docs for RT's new features
Browse files Browse the repository at this point in the history
  • Loading branch information
tomazfernandes authored and garyrussell committed Feb 22, 2022
1 parent 3c9e00f commit f338d56
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
17 changes: 10 additions & 7 deletions spring-kafka-docs/src/main/asciidoc/retrytopic.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ public RetryTopicConfiguration myRetryTopic(KafkaTemplate<String, MyPojo> templa

NOTE: The default is having no timeout set, which can also be achieved by providing -1 as the timout value.

[[retry-topic-ex-classifier]]
===== Exception Classifier

You can specify which exceptions you want to retry on and which not to.
Expand Down Expand Up @@ -307,8 +308,8 @@ public RetryTopicConfiguration myRetryTopic(KafkaTemplate<String, MyOtherPojo> t
NOTE: The default behavior is retrying on all exceptions and not traversing causes.

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.
See <<default-eh, DefaultErrorHandler>> for the default list of fatal exceptions.
You can add or remove exceptions with:
See <<default-eh>> for the default list of fatal exceptions.
You can add or remove exceptions to and from this list with:

====
[source, java]
Expand Down Expand Up @@ -642,10 +643,10 @@ public RetryTopicConfiguration myRetryTopic(KafkaTemplate<Integer, MyPojo> templ

NOTE: The default behavior is to `ALWAYS_RETRY_ON_ERROR`.

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,
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,
such as a `DeserializationException` because, generally, such exceptions will always be thrown.

Exceptions that are considered fatal are
Exceptions that are considered fatal are:

* `DeserializationException`
* `MessageConversionException`
Expand All @@ -654,7 +655,10 @@ Exceptions that are considered fatal are
* `NoSuchMethodException`
* `ClassCastException`

You can add exceptions to and remove exceptions from this list using methods on the `DeadLetterPublishingRecovererFactory` bean.
You can add exceptions to and remove exceptions from this list using methods on the `DestinationTopicResolver` bean.

See <<retry-topic-ex-classifier>> for more information.


===== Configuring No DLT

Expand Down Expand Up @@ -685,7 +689,7 @@ public RetryTopicConfiguration myRetryTopic(KafkaTemplate<Integer, MyPojo> templ
----
====


[[retry-topic-lcf]]
==== Specifying a ListenerContainerFactory

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.
Expand Down Expand Up @@ -723,7 +727,6 @@ public RetryTopicConfiguration myOtherRetryTopic(KafkaTemplate<Integer, MyPojo>
----
====


IMPORTANT: Since 2.8.3 you can use the same factory for retryable and non-retryable topics.

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:
Expand Down
11 changes: 8 additions & 3 deletions spring-kafka-docs/src/main/asciidoc/whats-new.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,14 @@ The property `stripPreviousExceptionHeaders` is now `true` by default.

See <<dlpr-headers>> for more information.

[[x28-kafka-back-off-exception-log-level]]
==== KafkaBackOffException Log Level Changes
[[x28-retryable-topics-changes]]
==== Retryable Topics Changes

The KafkaBackOffException thrown when using the retryable topics feature is now logged at DEBUG level.
Now you can use the same factory for retryable and non-retryable topics.
See <<retry-topic-lcf>> for more information.

There's now a manageable global list of fatal exceptions that will make the failed record go straight to the DLT.
Refer to <<retry-topic-ex-classifier>> to see how to manage it.

The KafkaBackOffException thrown when using the retryable topics feature is now logged at DEBUG level.
See <<change-kboe-logging-level>> if you need to change the logging level back to WARN or set it to any other level.

0 comments on commit f338d56

Please sign in to comment.