Skip to content

Commit b2f2af3

Browse files
authored
Deprecate Repeat functionality (#366)
Following previous Retry mechanisms deprecation, the remainder of the reactor.retry package has been deprecated. An alternative is available in reactor-core and this package is intended for deletion in the next major version of reactor-addons. Resolves #293. --------- Signed-off-by: Dariusz Jędrzejczyk <[email protected]>
1 parent 844df0c commit b2f2af3

17 files changed

+71
-17
lines changed

reactor-extra/src/main/java/reactor/retry/AbstractRetry.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2021 VMware Inc. or its affiliates, All Rights Reserved.
2+
* Copyright (c) 2017-2025 VMware Inc. or its affiliates, All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,6 +31,12 @@
3131
import reactor.util.Loggers;
3232
import reactor.util.annotation.Nullable;
3333

34+
/*
35+
* @deprecated To be removed in 3.7.0 at the earliest. Use reactor.util.repeat or
36+
* reactor.util.retry available since reactor-core 3.8.0 which provides similar
37+
* capabilities.
38+
*/
39+
@Deprecated
3440
public abstract class AbstractRetry<T, S> implements Function<Flux<S>, Publisher<Long>> {
3541

3642
static final Logger log = Loggers.getLogger(AbstractRetry.class);

reactor-extra/src/main/java/reactor/retry/Backoff.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2022 VMware Inc. or its affiliates, All Rights Reserved.
2+
* Copyright (c) 2017-2025 VMware Inc. or its affiliates, All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,7 +24,11 @@
2424
/**
2525
* Backoff function
2626
*
27+
* @deprecated To be removed in 3.7.0 at the earliest.
28+
* Use reactor.util.repeat or reactor.util.retry available since reactor-core 3.8.0
29+
* which provides similar capabilities.
2730
*/
31+
@Deprecated
2832
public interface Backoff extends Function<IterationContext<?>, BackoffDelay> {
2933

3034
Backoff ZERO_BACKOFF = new Backoff() {

reactor-extra/src/main/java/reactor/retry/BackoffDelay.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2021 VMware Inc. or its affiliates, All Rights Reserved.
2+
* Copyright (c) 2017-2025 VMware Inc. or its affiliates, All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,6 +18,12 @@
1818

1919
import java.time.Duration;
2020

21+
/*
22+
* @deprecated To be removed in 3.7.0 at the earliest. Use reactor.util.repeat or
23+
* reactor.util.retry available since reactor-core 3.8.0 which provides similar
24+
* capabilities.
25+
*/
26+
@Deprecated
2127
public class BackoffDelay {
2228

2329
static final BackoffDelay ZERO = new BackoffDelay(Duration.ZERO) {

reactor-extra/src/main/java/reactor/retry/DefaultContext.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2021 VMware Inc. or its affiliates, All Rights Reserved.
2+
* Copyright (c) 2017-2025 VMware Inc. or its affiliates, All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,6 +18,12 @@
1818

1919
import java.time.Duration;
2020

21+
/*
22+
* @deprecated To be removed in 3.7.0 at the earliest. Use reactor.util.repeat or
23+
* reactor.util.retry available since reactor-core 3.8.0 which provides similar
24+
* capabilities.
25+
*/
26+
@Deprecated
2127
public class DefaultContext<T> implements RetryContext<T>, RepeatContext<T> {
2228

2329
final T applicationContext;

reactor-extra/src/main/java/reactor/retry/DefaultRepeat.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2021 VMware Inc. or its affiliates, All Rights Reserved.
2+
* Copyright (c) 2017-2025 VMware Inc. or its affiliates, All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,6 +28,11 @@
2828
import reactor.util.Logger;
2929
import reactor.util.Loggers;
3030

31+
/*
32+
* @deprecated To be removed in 3.7.0 at the earliest. Use reactor.util.repeat.RepeatSpec
33+
* available since reactor-core 3.8.0 which provides similar capabilities.
34+
*/
35+
@Deprecated
3136
public class DefaultRepeat<T> extends AbstractRetry<T, Long> implements Repeat<T> {
3237

3338
static final Logger log = Loggers.getLogger(DefaultRepeat.class);

reactor-extra/src/main/java/reactor/retry/IterationContext.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2021 VMware Inc. or its affiliates, All Rights Reserved.
2+
* Copyright (c) 2017-2025 VMware Inc. or its affiliates, All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,7 +22,12 @@
2222
* Context provided to retry or repeat callbacks.
2323
*
2424
* @param <T> Application context type
25+
*
26+
* @deprecated To be removed in 3.7.0 at the earliest. Use reactor.util.repeat or
27+
* reactor.util.retry available since reactor-core 3.8.0 which provides similar
28+
* capabilities.
2529
*/
30+
@Deprecated
2631
public interface IterationContext<T> {
2732

2833
/**

reactor-extra/src/main/java/reactor/retry/Jitter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2021 VMware Inc. or its affiliates, All Rights Reserved.
2+
* Copyright (c) 2017-2025 VMware Inc. or its affiliates, All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,7 +23,11 @@
2323
/**
2424
* Jitter function that is applied to the backoff delay.
2525
*
26+
* @deprecated To be removed in 3.7.0 at the earliest. Use reactor.util.repeat or
27+
* reactor.util.retry available since reactor-core 3.8.0 which provides similar
28+
* capabilities.
2629
*/
30+
@Deprecated
2731
public interface Jitter extends Function<BackoffDelay, Duration> {
2832

2933
Jitter NO_JITTER = new Jitter() {

reactor-extra/src/main/java/reactor/retry/RandomJitter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018-2021 VMware Inc. or its affiliates, All Rights Reserved.
2+
* Copyright (c) 2018-2025 VMware Inc. or its affiliates, All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,7 +24,12 @@
2424
* maintain that invariant on the randomized {@literal d}.
2525
*
2626
* @author Simon Baslé
27+
*
28+
* @deprecated To be removed in 3.7.0 at the earliest. Use reactor.util.repeat or
29+
* reactor.util.retry available since reactor-core 3.8.0 which provides similar
30+
* capabilities.
2731
*/
32+
@Deprecated
2833
class RandomJitter implements Jitter {
2934

3035
private final double randomFactor;

reactor-extra/src/main/java/reactor/retry/Repeat.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2021 VMware Inc. or its affiliates, All Rights Reserved.
2+
* Copyright (c) 2017-2025 VMware Inc. or its affiliates, All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -52,7 +52,10 @@
5252
* to change both the timeout and limit the attempts.
5353
*
5454
* @param <T> Application context type
55+
* @deprecated To be removed in 3.7.0 at the earliest. Use reactor.util.repeat.RepeatSpec
56+
* available since reactor-core 3.8.0 which provides similar capabilities.
5557
*/
58+
@Deprecated
5659
public interface Repeat<T> extends Function<Flux<Long>, Publisher<Long>> {
5760

5861
/**

reactor-extra/src/main/java/reactor/retry/RepeatContext.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2021 VMware Inc. or its affiliates, All Rights Reserved.
2+
* Copyright (c) 2017-2025 VMware Inc. or its affiliates, All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,7 +24,10 @@
2424
* the repeat callback {@link Repeat#doOnRepeat(java.util.function.Consumer)}.
2525
*
2626
* @param <T> Application context type
27+
* @deprecated To be removed in 3.7.0 at the earliest. Use reactor.util.repeat.RepeatSpec
28+
* available since reactor-core 3.8.0 which provides similar capabilities.
2729
*/
30+
@Deprecated
2831
public interface RepeatContext<T> extends IterationContext<T> {
2932

3033
/**

0 commit comments

Comments
 (0)