public class FailOverLoadBalancer extends LoadBalancerSupport implements org.apache.camel.Traceable, org.apache.camel.CamelContextAware
Pipeline
in the async variation
as the failover load balancer is a specialized pipeline. So the trick is to keep doing the same as the
pipeline to ensure it works the same and the async routing engine is flawless.Modifier and Type | Class and Description |
---|---|
protected class |
FailOverLoadBalancer.State |
Constructor and Description |
---|
FailOverLoadBalancer() |
FailOverLoadBalancer(List<Class<?>> exceptions) |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart() |
protected void |
doStop() |
org.apache.camel.CamelContext |
getCamelContext() |
ExceptionFailureStatistics |
getExceptionFailureStatistics() |
List<Class<?>> |
getExceptions() |
int |
getLastGoodIndex() |
int |
getMaximumFailoverAttempts() |
String |
getTraceLabel() |
boolean |
isRoundRobin() |
boolean |
isRunAllowed() |
boolean |
isSticky() |
protected org.apache.camel.Exchange |
prepareExchangeForFailover(org.apache.camel.Exchange exchange)
Prepares the exchange for failover
|
boolean |
process(org.apache.camel.Exchange exchange,
org.apache.camel.AsyncCallback callback) |
void |
reset() |
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
void |
setMaximumFailoverAttempts(int maximumFailoverAttempts) |
void |
setRoundRobin(boolean roundRobin) |
void |
setSticky(boolean sticky) |
protected boolean |
shouldFailOver(org.apache.camel.Exchange exchange)
Should the given failed Exchange failover?
|
addProcessor, doGetProcessors, doShutdown, getId, getProcessors, hasNext, next, removeProcessor, setId, toString
build, doBuild, doInit, doResume, doSuspend, getStatus, init, isBuild, isInit, isNew, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public org.apache.camel.CamelContext getCamelContext()
getCamelContext
in interface org.apache.camel.CamelContextAware
public void setCamelContext(org.apache.camel.CamelContext camelContext)
setCamelContext
in interface org.apache.camel.CamelContextAware
public int getLastGoodIndex()
public boolean isRoundRobin()
public void setRoundRobin(boolean roundRobin)
public boolean isSticky()
public void setSticky(boolean sticky)
public int getMaximumFailoverAttempts()
public void setMaximumFailoverAttempts(int maximumFailoverAttempts)
protected boolean shouldFailOver(org.apache.camel.Exchange exchange)
exchange
- the exchange that failedpublic boolean isRunAllowed()
isRunAllowed
in interface org.apache.camel.StatefulService
isRunAllowed
in class org.apache.camel.support.service.ServiceSupport
public boolean process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
process
in interface org.apache.camel.AsyncProcessor
protected org.apache.camel.Exchange prepareExchangeForFailover(org.apache.camel.Exchange exchange)
exchange
- the exchangepublic String getTraceLabel()
getTraceLabel
in interface org.apache.camel.Traceable
public ExceptionFailureStatistics getExceptionFailureStatistics()
public void reset()
protected void doStart() throws Exception
doStart
in class LoadBalancerSupport
Exception
protected void doStop() throws Exception
doStop
in class LoadBalancerSupport
Exception
Apache Camel