Skip to content

Commit 649d483

Browse files
authored
GH-4035: Clarify docs on default non-blocking retry setup (#4058)
* Docs: clarify default non-blocking retry setup * Docs: format asciidoc files to one sentence per line Fixes #4035 **Auto-cherry-pick to `3.3.x`** Signed-off-by: Yuri Lee <[email protected]>
1 parent cc679a4 commit 649d483

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

spring-kafka-docs/src/main/antora/modules/ROOT/pages/retrytopic/retry-config.adoc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
[[retry-config]]
22
= Configuration
33

4-
Starting with version 2.9, for default configuration, the `@EnableKafkaRetryTopic` annotation should be used in a `@Configuration` annotated class.
5-
This enables the feature to bootstrap properly and gives access to injecting some of the feature's components to be looked up at runtime.
4+
For the default setup, enable non-blocking retries by adding the `@RetryableTopic` annotation to a `@KafkaListener` method.
5+
This is the recommended and simplest approach, as it automatically configures the required retry infrastructure and creates the retry and DLT topics with default settings.
6+
7+
To import the non-blocking retry infrastructure and expose its components as beans, annotate a `@Configuration` class with `@EnableKafkaRetryTopic`.
8+
This enables injection and runtime lookup of the feature’s components and serves as a foundation for advanced and global configuration.
69

710
NOTE: It is not necessary to also add `@EnableKafka`, if you add this annotation, because `@EnableKafkaRetryTopic` is meta-annotated with `@EnableKafka`.
811

9-
Also, starting with that version, for more advanced configuration of the feature's components and global features, the `RetryTopicConfigurationSupport` class should be extended in a `@Configuration` class, and the appropriate methods overridden.
12+
For advanced and global customization, extend `RetryTopicConfigurationSupport` in a single `@Configuration` class and override the relevant methods.
1013
For more details refer to xref:retrytopic/retry-config.adoc#retry-topic-global-settings[Configuring Global Settings and Features].
1114

1215
By default, the containers for the retry topics will have the same concurrency as the main container.
1316
Starting with version 3.0, you can set a different `concurrency` for the retry containers (either on the annotation, or in `RetryTopicConfigurationBuilder`).
1417

15-
IMPORTANT: Only one of the above techniques can be used, and only one `@Configuration` class can extend `RetryTopicConfigurationSupport`.
18+
[IMPORTANT]
19+
====
20+
Use only one of the two global configuration approaches above (`@EnableKafkaRetryTopic` or extending `RetryTopicConfigurationSupport`).
21+
In addition, only one `@Configuration` class should extend `RetryTopicConfigurationSupport`.
22+
====
1623

1724
[[using-the-retryabletopic-annotation]]
1825
== Using the `@RetryableTopic` annotation

0 commit comments

Comments
 (0)