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 protected
RetryPolicy(String name)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static RetryPolicy
getDefault()
Duration
getNextRetryInterval(String clientId, Exception lastException, Duration remainingTime)
Gets the Interval after which nextRetry should be done.static RetryPolicy
getNoRetry()
protected int
getRetryCount(String clientId)
void
incrementRetryCount(String clientId)
static boolean
isRetryableException(Exception exception)
protected abstract Duration
onGetNextRetryInterval(String clientId, Exception lastException, Duration remainingTime, int baseWaitTime)
void
resetRetryCount(String clientId)
String
toString()
-
-
-
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)
-
-