public class RequestSpecificRetryHandler extends java.lang.Object implements RetryHandler
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<java.lang.Class<? extends java.lang.Throwable>> |
connectionRelated |
DEFAULT| Constructor and Description |
|---|
RequestSpecificRetryHandler(boolean okToRetryOnConnectErrors,
boolean okToRetryOnAllErrors) |
RequestSpecificRetryHandler(boolean okToRetryOnConnectErrors,
boolean okToRetryOnAllErrors,
RetryHandler baseRetryHandler,
IClientConfig requestConfig) |
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxRetriesOnNextServer() |
int |
getMaxRetriesOnSameServer() |
boolean |
isCircuitTrippingException(java.lang.Throwable e)
Test if an exception should be treated as circuit failure.
|
boolean |
isConnectionException(java.lang.Throwable e) |
boolean |
isRetriableException(java.lang.Throwable e,
boolean sameServer)
Test if an exception is retriable for the load balancer
|
protected java.util.List<java.lang.Class<? extends java.lang.Throwable>> connectionRelated
public RequestSpecificRetryHandler(boolean okToRetryOnConnectErrors,
boolean okToRetryOnAllErrors)
public RequestSpecificRetryHandler(boolean okToRetryOnConnectErrors,
boolean okToRetryOnAllErrors,
RetryHandler baseRetryHandler,
@Nullable
IClientConfig requestConfig)
public boolean isConnectionException(java.lang.Throwable e)
public boolean isRetriableException(java.lang.Throwable e,
boolean sameServer)
RetryHandlerisRetriableException in interface RetryHandlere - the original exceptionsameServer - if true, the method is trying to determine if retry can be
done on the same server. Otherwise, it is testing whether retry can be
done on a different serverpublic boolean isCircuitTrippingException(java.lang.Throwable e)
RetryHandlerConnectException is a circuit failure. This is used to determine
whether successive exceptions of such should trip the circuit breaker to a particular
host by the load balancer. If false but a server response is absent,
load balancer will also close the circuit upon getting such exception.isCircuitTrippingException in interface RetryHandlerpublic int getMaxRetriesOnSameServer()
getMaxRetriesOnSameServer in interface RetryHandlerpublic int getMaxRetriesOnNextServer()
getMaxRetriesOnNextServer in interface RetryHandler