共用方式為


ExceptionHandlingRetryResult Class

  • java.lang.Object

public class ExceptionHandlingRetryResult extends ExceptionHandlingResult

Specifies the exception handling result when the request from client to service can be retried

Constructor Summary

Constructor Description
ExceptionHandlingRetryResult(String exceptionId, boolean isTransient, Duration retryDelay, int maxRetryCount)

Instantiates the ExceptionHandlingRetryResult using the given arguments.

ExceptionHandlingRetryResult(Throwable exception, boolean isTransient, Duration retryDelay, int maxRetryCount)

Instantiates the ExceptionHandlingRetryResult using the given arguments.

ExceptionHandlingRetryResult(Throwable exception, boolean isTransient, OperationRetrySettings retrySettings, int maxRetryCount)

Instantiates the ExceptionHandlingRetryResult using the given arguments.

Method Summary

Modifier and Type Method and Description
String getExceptionId()

String that uniquely identifies the exception type.

int getMaxRetryCount()

Maximum number of times this exception type needs to be retried before giving up. The default value is int.MaxValue

Duration getRetryDelay()

The operation should be retried after this delay.

boolean isTransient()

Transient retriable exceptions are those where the communication channel from client to service still exists. Non transient retriable exceptions are those where we need to re-resolve the service endpoint before we retry.

Constructor Details

ExceptionHandlingRetryResult

public ExceptionHandlingRetryResult(String exceptionId, boolean isTransient, Duration retryDelay, int maxRetryCount)

Instantiates the ExceptionHandlingRetryResult using the given arguments.

Parameters:

exceptionId - An identifier for the exception that needs to be retried.
isTransient - Indicates if this is a transient retriable exception. Transient retriable exceptions are those where the communication channel from client to service still exists. Non transient retriable exceptions are those where we need to re-resolve the service endpoint before we retry.
retryDelay - The interval to wait before retrying
maxRetryCount - The maximum number of times the exception identified by the exceptionId parameter needs to be retried for.

ExceptionHandlingRetryResult

public ExceptionHandlingRetryResult(Throwable exception, boolean isTransient, Duration retryDelay, int maxRetryCount)

Instantiates the ExceptionHandlingRetryResult using the given arguments.

Parameters:

exception - An identifier for the exception that needs to be retried.
isTransient - Indicates if this is a transient retriable exception. Transient retriable exceptions are those where the communication channel from client to service still exists. Non transient retriable exceptions are those where we need to re-resolve the service endpoint before we retry.
retryDelay - The interval to wait before retrying
maxRetryCount - The maximum number of times the exception identified by the exceptionId parameter needs to be retried for.

ExceptionHandlingRetryResult

public ExceptionHandlingRetryResult(Throwable exception, boolean isTransient, OperationRetrySettings retrySettings, int maxRetryCount)

Instantiates the ExceptionHandlingRetryResult using the given arguments.

Parameters:

exception - The exception that needs to be retried.
isTransient - Indicates if this is a transient retriable exception. Transient retriable exceptions are those where the communication channel from client to service still exists. Non transient retriable exceptions are those where we need to re-resolve the service endpoint before we retry.
retrySettings - The retrySettings from which the interval to wait before retrying is figured out.
maxRetryCount - The maximum number of times the exception identified by the exceptionId parameter needs to be retried for.

Method Details

getExceptionId

public String getExceptionId()

String that uniquely identifies the exception type.

Returns:

Unique id for this exception. This id is used to keep track of the number of times this exception is retried

getMaxRetryCount

public int getMaxRetryCount()

Maximum number of times this exception type needs to be retried before giving up. The default value is int.MaxValue

Returns:

Max retry count

getRetryDelay

public Duration getRetryDelay()

The operation should be retried after this delay.

Returns:

Time delay after which the operation should be retried

isTransient

public boolean isTransient()

Transient retriable exceptions are those where the communication channel from client to service still exists. Non transient retriable exceptions are those where we need to re-resolve the service endpoint before we retry.

Returns:

true indicates that this is a transient retriable exception. false indicates that this is a non transient retriable exception.

Applies to