AmqpRetryPolicy Class
- java.
lang. Object - com.
azure. core. amqp. AmqpRetryPolicy
- com.
public abstract class AmqpRetryPolicy
An abstract representation of a policy to govern retrying of messaging operations.
Constructor Summary
| Modifier | Constructor | Description |
|---|---|---|
| protected | AmqpRetryPolicy(AmqpRetryOptions retryOptions) |
Creates an instance with the given retry options. |
Method Summary
| 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 |
| 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. |
|
Amqp |
getRetryOptions()
Gets the set of options used to configure this retry policy. |
| int | hashCode() |
Methods inherited from java.lang.Object
Constructor Details
AmqpRetryPolicy
protected AmqpRetryPolicy(AmqpRetryOptions retryOptions)
Creates an instance with the given retry options. If getMaxDelay(), getDelay(), or getMaxRetries() is equal to Duration#ZERO or zero, requests failing with a retriable exception will not be retried.
Parameters:
Method Details
calculateRetryDelay
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.
Parameters:
Returns:
null if the it cannot be
retried.calculateRetryDelay
public Duration calculateRetryDelay(Throwable lastException, int retryCount)
Calculates the amount of time to delay before the next retry attempt.
Parameters:
Returns:
null, then the operation
is no longer eligible to be retried.equals
public boolean equals(Object obj)
Overrides:
AmqpRetryPolicy.equals(Object obj)Parameters:
getMaxRetries
public int getMaxRetries()
Gets the maximum number of retry attempts.
Returns:
getRetryOptions
public AmqpRetryOptions getRetryOptions()
Gets the set of options used to configure this retry policy.
Returns:
hashCode
public int hashCode()
Overrides:
AmqpRetryPolicy.hashCode()