Skip to content

Commit 4cdfd90

Browse files
committed
Polish backoff and retry support
This revises commit 15dd320. See gh-34529 See gh-35110
1 parent 96f0399 commit 4cdfd90

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

spring-aop/src/main/java/org/springframework/aop/retry/MethodRetrySpec.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
* @param excludes non-applicable exception types to avoid a retry for
3232
* @param predicate a predicate for filtering exceptions from applicable methods
3333
* @param maxAttempts the maximum number of retry attempts
34-
* @param delay the base delay after the initial invocation (in milliseconds)
35-
* @param jitter a jitter value for the next retry attempt (in milliseconds)
34+
* @param delay the base delay after the initial invocation
35+
* @param jitter a jitter value for the next retry attempt
3636
* @param multiplier a multiplier for a delay for the next retry attempt
37-
* @param maxDelay the maximum delay for any retry attempt (in milliseconds)
37+
* @param maxDelay the maximum delay for any retry attempt
3838
* @see AbstractRetryInterceptor#getRetrySpec
3939
* @see SimpleRetryInterceptor#SimpleRetryInterceptor(MethodRetrySpec)
4040
* @see org.springframework.aop.retry.annotation.Retryable

spring-aop/src/main/java/org/springframework/aop/retry/annotation/Retryable.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
* @since 7.0
4444
* @see RetryAnnotationBeanPostProcessor
4545
* @see RetryAnnotationInterceptor
46+
* @see org.springframework.core.retry.RetryPolicy
4647
* @see org.springframework.core.retry.RetryTemplate
4748
* @see reactor.core.publisher.Mono#retryWhen
4849
* @see reactor.core.publisher.Flux#retryWhen
@@ -95,8 +96,8 @@
9596
long maxAttempts() default 3;
9697

9798
/**
98-
* The base delay after the initial invocation in milliseconds. If a multiplier
99-
* is specified, this serves as the initial delay to multiply from.
99+
* The base delay after the initial invocation. If a multiplier is specified,
100+
* this serves as the initial delay to multiply from.
100101
* <p>The time unit is milliseconds by default but can be overridden via
101102
* {@link #timeUnit}.
102103
* <p>The default is 1000.
@@ -147,7 +148,7 @@
147148
/**
148149
* The {@link TimeUnit} to use for {@link #delay}, {@link #jitter},
149150
* and {@link #maxDelay}.
150-
* <p>Defaults to {@link TimeUnit#MILLISECONDS}.
151+
* <p>The default is {@link TimeUnit#MILLISECONDS}.
151152
*/
152153
TimeUnit timeUnit() default TimeUnit.MILLISECONDS;
153154

spring-core/src/main/java/org/springframework/util/backoff/ExponentialBackOff.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public class ExponentialBackOff implements BackOff {
9090
* The default maximum attempts: unlimited.
9191
* @since 6.1
9292
*/
93-
public static final int DEFAULT_MAX_ATTEMPTS = Integer.MAX_VALUE;
93+
public static final long DEFAULT_MAX_ATTEMPTS = Long.MAX_VALUE;
9494

9595

9696
private long initialInterval = DEFAULT_INITIAL_INTERVAL;

0 commit comments

Comments
 (0)