From e5d08552d9c0453ff96583abb74b3a44bb7a91c5 Mon Sep 17 00:00:00 2001 From: Yuri Lee Date: Thu, 21 Aug 2025 17:08:58 +0900 Subject: [PATCH 1/2] Docs: clarify default non-blocking retry setup Signed-off-by: Yuri Lee --- .../modules/ROOT/pages/retrytopic/retry-config.adoc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/retrytopic/retry-config.adoc b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/retrytopic/retry-config.adoc index cc359a75b4..4efdf33c21 100644 --- a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/retrytopic/retry-config.adoc +++ b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/retrytopic/retry-config.adoc @@ -1,18 +1,19 @@ [[retry-config]] = Configuration -Starting with version 2.9, for default configuration, the `@EnableKafkaRetryTopic` annotation should be used in a `@Configuration` annotated class. -This enables the feature to bootstrap properly and gives access to injecting some of the feature's components to be looked up at runtime. +For the default setup, enable non-blocking retries by adding the `@RetryableTopic` annotation to a `@KafkaListener` method. 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. + +To import the non-blocking retry infrastructure and expose its components as beans, annotate a `@Configuration` class with `@EnableKafkaRetryTopic`. This enables injection and runtime lookup of the feature’s components and serves as a foundation for advanced and global configuration. NOTE: It is not necessary to also add `@EnableKafka`, if you add this annotation, because `@EnableKafkaRetryTopic` is meta-annotated with `@EnableKafka`. -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. +For advanced and global customization, extend `RetryTopicConfigurationSupport` in a single `@Configuration` class and override the relevant methods. For more details refer to xref:retrytopic/retry-config.adoc#retry-topic-global-settings[Configuring Global Settings and Features]. By default, the containers for the retry topics will have the same concurrency as the main container. Starting with version 3.0, you can set a different `concurrency` for the retry containers (either on the annotation, or in `RetryTopicConfigurationBuilder`). -IMPORTANT: Only one of the above techniques can be used, and only one `@Configuration` class can extend `RetryTopicConfigurationSupport`. +IMPORTANT: Use only one of the two global configuration approaches above (`@EnableKafkaRetryTopic` or extending `RetryTopicConfigurationSupport`). In addition, only one `@Configuration` class should extend `RetryTopicConfigurationSupport`. [[using-the-retryabletopic-annotation]] == Using the `@RetryableTopic` annotation From 45fb2e5889424ff5f5f7ec20c7a07419e0e6a576 Mon Sep 17 00:00:00 2001 From: Yuri Lee Date: Tue, 26 Aug 2025 10:56:53 +0900 Subject: [PATCH 2/2] Docs: format asciidoc files to one sentence per line Signed-off-by: Yuri Lee --- .../modules/ROOT/pages/retrytopic/retry-config.adoc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/retrytopic/retry-config.adoc b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/retrytopic/retry-config.adoc index 4efdf33c21..0451e078b9 100644 --- a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/retrytopic/retry-config.adoc +++ b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/retrytopic/retry-config.adoc @@ -1,9 +1,11 @@ [[retry-config]] = Configuration -For the default setup, enable non-blocking retries by adding the `@RetryableTopic` annotation to a `@KafkaListener` method. 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. +For the default setup, enable non-blocking retries by adding the `@RetryableTopic` annotation to a `@KafkaListener` method. +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. -To import the non-blocking retry infrastructure and expose its components as beans, annotate a `@Configuration` class with `@EnableKafkaRetryTopic`. This enables injection and runtime lookup of the feature’s components and serves as a foundation for advanced and global configuration. +To import the non-blocking retry infrastructure and expose its components as beans, annotate a `@Configuration` class with `@EnableKafkaRetryTopic`. +This enables injection and runtime lookup of the feature’s components and serves as a foundation for advanced and global configuration. NOTE: It is not necessary to also add `@EnableKafka`, if you add this annotation, because `@EnableKafkaRetryTopic` is meta-annotated with `@EnableKafka`. @@ -13,7 +15,11 @@ For more details refer to xref:retrytopic/retry-config.adoc#retry-topic-global-s By default, the containers for the retry topics will have the same concurrency as the main container. Starting with version 3.0, you can set a different `concurrency` for the retry containers (either on the annotation, or in `RetryTopicConfigurationBuilder`). -IMPORTANT: Use only one of the two global configuration approaches above (`@EnableKafkaRetryTopic` or extending `RetryTopicConfigurationSupport`). In addition, only one `@Configuration` class should extend `RetryTopicConfigurationSupport`. +[IMPORTANT] +==== +Use only one of the two global configuration approaches above (`@EnableKafkaRetryTopic` or extending `RetryTopicConfigurationSupport`). +In addition, only one `@Configuration` class should extend `RetryTopicConfigurationSupport`. +==== [[using-the-retryabletopic-annotation]] == Using the `@RetryableTopic` annotation