Class RetryExponential
- java.lang.Object
-
- com.microsoft.azure.servicebus.primitives.RetryPolicy
-
- com.microsoft.azure.servicebus.primitives.RetryExponential
-
public final class RetryExponential extends RetryPolicy
RetryPolicy implementation where the delay between retries will grow in an exponential manner. RetryPolicy can be set on the client operations usingConnectionStringBuilder
. RetryIntervals will be computed using a retryFactor which is a function of deltaBackOff (MaximumBackoff - MinimumBackoff) and MaximumRetryCount- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description RetryExponential(Duration minimumBackoff, Duration maximumBackoff, int maximumRetryCount, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Duration
onGetNextRetryInterval(String clientId, Exception lastException, Duration remainingTime, int baseWaitTimeSecs)
Adjusts the interval after which nextRetry should be attempted, based on the last exception encountered, the remaining time before the operation times out and the minimum wait time before retry.-
Methods inherited from class com.microsoft.azure.servicebus.primitives.RetryPolicy
getDefault, getNextRetryInterval, getNoRetry, getRetryCount, incrementRetryCount, isRetryableException, resetRetryCount, toString
-
-
-
-
Method Detail
-
onGetNextRetryInterval
protected Duration onGetNextRetryInterval(String clientId, Exception lastException, Duration remainingTime, int baseWaitTimeSecs)
Description copied from class:RetryPolicy
Adjusts the interval after which nextRetry should be attempted, based on the last exception encountered, the remaining time before the operation times out and the minimum wait time before retry. Clients can override this method to specify a wait time based on the exception encountered.- Specified by:
onGetNextRetryInterval
in classRetryPolicy
- Parameters:
clientId
- id of the sender or receiver or client object that encountered the exception.lastException
- last exception encounteredremainingTime
- remainingTime to retry before the operation times outbaseWaitTimeSecs
- minimum wait time determined by the base retry policy. Overriding methods can return a different value.- Returns:
- duration after which the operation will be retried. Returns null when the operation should not retried
-
-