public abstract class AmqpRetryPolicy extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
AmqpRetryPolicy(AmqpRetryOptions retryOptions)
Creates an instance with the given retry options.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract Duration |
calculateRetryDelay(int retryCount,
Duration baseDelay,
Duration baseJitter,
ThreadLocalRandom random)
Calculates the amount of time to delay before the next retry attempt based on the
retryCount,
baseDelay, and baseJitter. |
Duration |
calculateRetryDelay(Throwable lastException,
int retryCount)
Calculates the amount of time to delay before the next retry attempt.
|
boolean |
equals(Object obj) |
int |
getMaxRetries()
Gets the maximum number of retry attempts.
|
AmqpRetryOptions |
getRetryOptions()
Gets the set of options used to configure this retry policy.
|
int |
hashCode() |
protected AmqpRetryPolicy(AmqpRetryOptions retryOptions)
AmqpRetryOptions.getMaxDelay(), AmqpRetryOptions.getDelay(), or AmqpRetryOptions.getMaxRetries() is equal to Duration.ZERO or
zero, requests failing with a retriable exception will not be retried.retryOptions - The options to set on this retry policy.NullPointerException - if retryOptions is null.public AmqpRetryOptions getRetryOptions()
public int getMaxRetries()
public Duration calculateRetryDelay(Throwable lastException, int retryCount)
lastException - The last exception that was observed for the operation to be retried.retryCount - The number of attempts that have been made, including the initial attempt before any retries.null, then the operation
is no longer eligible to be retried.protected abstract Duration calculateRetryDelay(int retryCount, Duration baseDelay, Duration baseJitter, ThreadLocalRandom random)
retryCount,
baseDelay, and baseJitter.retryCount - The number of attempts that have been made, including the initial attempt before any retries.baseDelay - The base delay for a retry attempt.baseJitter - The base jitter delay.random - The random number generator. Can be utilised to calculate a random jitter value for the retry.null if the it cannot be
retried.Copyright © 2021 Microsoft Corporation. All rights reserved.