RetryPolicy Class

  • java.lang.Object
    • com.microsoft.azure.eventhubs.RetryPolicy

public abstract class RetryPolicy

Constructor Summary

Modifier Constructor Description
protected RetryPolicy(String name)

Method Summary

Modifier and Type Method and 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()

Methods inherited from java.lang.Object

Constructor Details

RetryPolicy

protected RetryPolicy(String name)

Parameters:

name

Method Details

getDefault

public static RetryPolicy getDefault()

getNextRetryInterval

public Duration getNextRetryInterval(String clientId, Exception lastException, Duration remainingTime)

Gets the Interval after which nextRetry should be done.

Parameters:

clientId - clientId
lastException - lastException
remainingTime - remainingTime to retry

Returns:

returns 'null' Duration when not Allowed

getNoRetry

public static RetryPolicy getNoRetry()

getRetryCount

protected int getRetryCount(String clientId)

Parameters:

clientId

incrementRetryCount

public void incrementRetryCount(String clientId)

Parameters:

clientId

isRetryableException

public static boolean isRetryableException(Exception exception)

Parameters:

exception

onGetNextRetryInterval

protected abstract Duration onGetNextRetryInterval(String clientId, Exception lastException, Duration remainingTime, int baseWaitTime)

Parameters:

clientId
lastException
remainingTime
baseWaitTime

resetRetryCount

public void resetRetryCount(String clientId)

Parameters:

clientId

toString

public String toString()

Overrides:

RetryPolicy.toString()

Applies to