Replace deprecated FixedDelay in docs (#3912)

* Replace `FixedDelayStrategy` to `SameIntervalTopicReuseStrategy` in docs

* `useSingleTopicForFixedDelays` -> `useSingleTopicForSameIntervals`

Signed-off-by: Seonghyeon Cho <seonghyeoncho96@gmail.com>

(cherry picked from commit f83cb266e7)
This commit is contained in:
Seonghyeon Cho (조성현)
2025-05-20 00:51:58 +09:00
committed by Spring Builds
parent 29073e26af
commit af66a68f13
2 changed files with 3 additions and 3 deletions

View File

@@ -79,7 +79,7 @@ NOTE: The previous `FixedDelayStrategy` is now deprecated, and can be replaced b
[source, java]
----
@RetryableTopic(backoff = @Backoff(2_000), fixedDelayTopicStrategy = FixedDelayStrategy.SINGLE_TOPIC)
@RetryableTopic(backoff = @Backoff(2_000), sameIntervalTopicReuseStrategy = SameIntervalTopicReuseStrategy.SINGLE_TOPIC)
@KafkaListener(topics = "my-annotated-topic")
public void processMessage(MyPojo message) {
// ... message processing
@@ -94,7 +94,7 @@ public RetryTopicConfiguration myRetryTopic(KafkaTemplate<String, MyPojo> templa
.newInstance()
.fixedBackOff(3_000)
.maxAttempts(5)
.useSingleTopicForFixedDelays()
.useSingleTopicForSameIntervals()
.create(template);
}
----

View File

@@ -39,7 +39,7 @@ import org.springframework.kafka.retrytopic.RetryTopicConfigurationSupport;
* &#064;Component
* public class MyListener {
*
* &#064;RetryableTopic(fixedDelayTopicStrategy = FixedDelayStrategy.SINGLE_TOPIC, backoff = @Backoff(4000))
* &#064;RetryableTopic(sameIntervalTopicReuseStrategy = SameIntervalTopicReuseStrategy.SINGLE_TOPIC, backoff = @Backoff(4000))
* &#064;KafkaListener(topics = "myTopic")
* public void listen(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) String receivedTopic) {
* logger.info("Message {} received in topic {} ", message, receivedTopic);