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:
committed by
Spring Builds
parent
29073e26af
commit
af66a68f13
@@ -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);
|
||||
}
|
||||
----
|
||||
|
||||
@@ -39,7 +39,7 @@ import org.springframework.kafka.retrytopic.RetryTopicConfigurationSupport;
|
||||
* @Component
|
||||
* public class MyListener {
|
||||
*
|
||||
* @RetryableTopic(fixedDelayTopicStrategy = FixedDelayStrategy.SINGLE_TOPIC, backoff = @Backoff(4000))
|
||||
* @RetryableTopic(sameIntervalTopicReuseStrategy = SameIntervalTopicReuseStrategy.SINGLE_TOPIC, backoff = @Backoff(4000))
|
||||
* @KafkaListener(topics = "myTopic")
|
||||
* public void listen(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) String receivedTopic) {
|
||||
* logger.info("Message {} received in topic {} ", message, receivedTopic);
|
||||
|
||||
Reference in New Issue
Block a user