public class InfiniteExponentialBackoffPolicy extends Object implements RetryPolicy
This policy retries indefinitely with exponential backoff up to a maximum wait time, and adds random jitter to prevent thundering herd problems when multiple clients retry simultaneously.
This policy is suitable for transient errors like rate limiting (429) or temporary service unavailability.
Wait time calculation: base_wait = 2^(attempt-1) seconds (capped at 64 seconds) With jitter: final_wait = base_wait + (base_wait * 0.1 * random) Max wait time: 64 seconds
| Modifier and Type | Field and Description |
|---|---|
static InfiniteExponentialBackoffPolicy |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
long |
getRetryWaitTime(int attempt)
Calculates the wait time before the next retry attempt.
|
boolean |
shouldRetry(Exception e,
int attempt)
Determines whether an operation should be retried based on the exception and attempt count.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwaitForNextRetrypublic static final InfiniteExponentialBackoffPolicy INSTANCE
public boolean shouldRetry(Exception e, int attempt)
RetryPolicyshouldRetry in interface RetryPolicye - The exception that occurredattempt - The current attempt number (1-based)public long getRetryWaitTime(int attempt)
RetryPolicygetRetryWaitTime in interface RetryPolicyattempt - The current attempt number (1-based)Copyright © 2026 Alibaba Cloud Computing. All rights reserved.