public class CircuitBreakerTargetSelector extends FailoverTargetSelector
FailoverTargetSelector.InvocationContext
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_THESHOLD |
static int |
DEFAULT_TIMEOUT |
failoverStrategy
CONDUIT_COMPARE_FULL_URL, conduits, endpoint, KEEP_CONDUIT_ALIVE
Constructor and Description |
---|
CircuitBreakerTargetSelector() |
CircuitBreakerTargetSelector(int threshold,
long timeout) |
CircuitBreakerTargetSelector(int threshold,
long timeout,
String clientBootstrapAddress) |
Modifier and Type | Method and Description |
---|---|
protected Endpoint |
getFailoverTarget(Exchange exchange,
FailoverTargetSelector.InvocationContext invocation)
Get the failover target endpoint, if a suitable one is available.
|
protected void |
onFailure(FailoverTargetSelector.InvocationContext context,
Exception ex) |
protected void |
onSuccess(FailoverTargetSelector.InvocationContext context) |
Conduit |
selectConduit(Message message)
Called when a Conduit is actually required.
|
void |
setStrategy(FailoverStrategy strategy) |
complete, doComplete, getClientBootstrapAddress, getDelayBetweenRetries, getInvocationContext, getInvocationKey, getLogger, getStrategy, isSupportNotAvailableErrorsOnly, overrideAddressProperty, overrideAddressProperty, performFailover, prepare, replaceEndpointAddressPropertyIfNeeded, requiresFailover, setClientBootstrapAddress, setOriginalEndpoint, setSupportNotAvailableErrorsOnly, setupExchangeExceptionProperties, updateContextAlternatives
close, createConduit, findCompatibleConduit, getEndpoint, getSelectedConduit, removeConduit, setEndpoint
public static final int DEFAULT_TIMEOUT
public static final int DEFAULT_THESHOLD
public CircuitBreakerTargetSelector(int threshold, long timeout)
public CircuitBreakerTargetSelector(int threshold, long timeout, String clientBootstrapAddress)
public CircuitBreakerTargetSelector()
public void setStrategy(FailoverStrategy strategy)
setStrategy
in class FailoverTargetSelector
strategy
- the FailoverStrategy to usepublic Conduit selectConduit(Message message)
FailoverTargetSelector
selectConduit
in interface ConduitSelector
selectConduit
in class FailoverTargetSelector
protected Endpoint getFailoverTarget(Exchange exchange, FailoverTargetSelector.InvocationContext invocation)
FailoverTargetSelector
getFailoverTarget
in class FailoverTargetSelector
exchange
- the current Exchangeinvocation
- the current InvocationContextprotected void onFailure(FailoverTargetSelector.InvocationContext context, Exception ex)
onFailure
in class FailoverTargetSelector
protected void onSuccess(FailoverTargetSelector.InvocationContext context)
onSuccess
in class FailoverTargetSelector
Apache CXF