Polish backoff and retry support
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details

This revises commit 15dd320b95.

See gh-34529
See gh-35110
This commit is contained in:
Sam Brannen 2025-06-28 19:14:45 +02:00
parent 96f0399072
commit 4cdfd90882
3 changed files with 8 additions and 7 deletions

View File

@ -31,10 +31,10 @@ import java.util.Collections;
* @param excludes non-applicable exception types to avoid a retry for
* @param predicate a predicate for filtering exceptions from applicable methods
* @param maxAttempts the maximum number of retry attempts
* @param delay the base delay after the initial invocation (in milliseconds)
* @param jitter a jitter value for the next retry attempt (in milliseconds)
* @param delay the base delay after the initial invocation
* @param jitter a jitter value for the next retry attempt
* @param multiplier a multiplier for a delay for the next retry attempt
* @param maxDelay the maximum delay for any retry attempt (in milliseconds)
* @param maxDelay the maximum delay for any retry attempt
* @see AbstractRetryInterceptor#getRetrySpec
* @see SimpleRetryInterceptor#SimpleRetryInterceptor(MethodRetrySpec)
* @see org.springframework.aop.retry.annotation.Retryable

View File

@ -43,6 +43,7 @@ import org.springframework.core.annotation.AliasFor;
* @since 7.0
* @see RetryAnnotationBeanPostProcessor
* @see RetryAnnotationInterceptor
* @see org.springframework.core.retry.RetryPolicy
* @see org.springframework.core.retry.RetryTemplate
* @see reactor.core.publisher.Mono#retryWhen
* @see reactor.core.publisher.Flux#retryWhen
@ -95,8 +96,8 @@ public @interface Retryable {
long maxAttempts() default 3;
/**
* The base delay after the initial invocation in milliseconds. If a multiplier
* is specified, this serves as the initial delay to multiply from.
* The base delay after the initial invocation. If a multiplier is specified,
* this serves as the initial delay to multiply from.
* <p>The time unit is milliseconds by default but can be overridden via
* {@link #timeUnit}.
* <p>The default is 1000.
@ -147,7 +148,7 @@ public @interface Retryable {
/**
* The {@link TimeUnit} to use for {@link #delay}, {@link #jitter},
* and {@link #maxDelay}.
* <p>Defaults to {@link TimeUnit#MILLISECONDS}.
* <p>The default is {@link TimeUnit#MILLISECONDS}.
*/
TimeUnit timeUnit() default TimeUnit.MILLISECONDS;

View File

@ -90,7 +90,7 @@ public class ExponentialBackOff implements BackOff {
* The default maximum attempts: unlimited.
* @since 6.1
*/
public static final int DEFAULT_MAX_ATTEMPTS = Integer.MAX_VALUE;
public static final long DEFAULT_MAX_ATTEMPTS = Long.MAX_VALUE;
private long initialInterval = DEFAULT_INITIAL_INTERVAL;