Package com.microsoft.azure.eventhubs
Class RetryPolicy
- java.lang.Object
-
- com.microsoft.azure.eventhubs.RetryPolicy
-
- Direct Known Subclasses:
RetryExponential
public abstract class RetryPolicy extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRetryPolicy(String name)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static RetryPolicygetDefault()DurationgetNextRetryInterval(String clientId, Exception lastException, Duration remainingTime)Gets the Interval after which nextRetry should be done.static RetryPolicygetNoRetry()protected intgetRetryCount(String clientId)voidincrementRetryCount(String clientId)static booleanisRetryableException(Exception exception)protected abstract DurationonGetNextRetryInterval(String clientId, Exception lastException, Duration remainingTime, int baseWaitTime)voidresetRetryCount(String clientId)StringtoString()
-
-
-
Constructor Detail
-
RetryPolicy
protected RetryPolicy(String name)
-
-
Method Detail
-
isRetryableException
public static boolean isRetryableException(Exception exception)
-
getDefault
public static RetryPolicy getDefault()
-
getNoRetry
public static RetryPolicy getNoRetry()
-
incrementRetryCount
public void incrementRetryCount(String clientId)
-
resetRetryCount
public void resetRetryCount(String clientId)
-
getRetryCount
protected int getRetryCount(String clientId)
-
getNextRetryInterval
public Duration getNextRetryInterval(String clientId, Exception lastException, Duration remainingTime)
Gets the Interval after which nextRetry should be done.- Parameters:
clientId- clientIdlastException- lastExceptionremainingTime- remainingTime to retry- Returns:
- returns 'null' Duration when not Allowed
-
onGetNextRetryInterval
protected abstract Duration onGetNextRetryInterval(String clientId, Exception lastException, Duration remainingTime, int baseWaitTime)
-
-