public class CircuitBreakerLoadBalancer extends LoadBalancerSupport implements Traceable, CamelContextAware
logshutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
CircuitBreakerLoadBalancer() |
CircuitBreakerLoadBalancer(List<Class<?>> exceptions) |
| Modifier and Type | Method and Description |
|---|---|
CamelContext |
getCamelContext()
Get the
CamelContext |
List<Class<?>> |
getExceptions() |
String |
getTraceLabel()
Gets the trace label used for logging when tracing is enabled.
|
protected boolean |
hasFailed(Exchange exchange) |
boolean |
isRunAllowed()
Helper methods so the service knows if it should keep running.
|
boolean |
process(Exchange exchange,
AsyncCallback callback)
Processes the message exchange.
|
void |
setCamelContext(CamelContext camelContext)
Injects the
CamelContext |
void |
setHalfOpenAfter(long halfOpenAfter) |
void |
setThreshold(int threshold) |
String |
toString() |
addProcessor, doShutdown, doStart, doStop, getId, getProcessors, hasNext, next, process, removeProcessor, setIddoResume, doSuspend, getStatus, getVersion, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic void setHalfOpenAfter(long halfOpenAfter)
public void setThreshold(int threshold)
public CamelContext getCamelContext()
CamelContextAwareCamelContextgetCamelContext in interface CamelContextAwarepublic void setCamelContext(CamelContext camelContext)
CamelContextAwareCamelContextsetCamelContext in interface CamelContextAwarecamelContext - the Camel contextprotected boolean hasFailed(Exchange exchange)
public boolean isRunAllowed()
StatefulServiceisRunAllowed in interface StatefulServiceisRunAllowed in class ServiceSupportpublic boolean process(Exchange exchange, AsyncCallback callback)
AsyncProcessorProcessor.process(org.apache.camel.Exchange), but the caller supports having the exchange asynchronously processed.
If there was a failure processing then the caused Exception would be set on the Exchange.process in interface AsyncProcessorexchange - the message exchangecallback - the AsyncCallback will be invoked when the processing of the exchange is completed.
If the exchange is completed synchronously, then the callback is also invoked synchronously.
The callback should therefore be careful of starting recursive loop.public String getTraceLabel()
TraceablegetTraceLabel in interface TraceableApache Camel