public class DefaultSupervisingRouteController extends DefaultRouteController implements org.apache.camel.spi.SupervisingRouteController
RouteController
that delays the startup of the routes after the camel context startup
and takes control of starting the routes in a safe manner. This controller is able to retry starting failing routes,
and have various options to configure settings for backoff between restarting routes.DefaultRouteController
Constructor and Description |
---|
DefaultSupervisingRouteController() |
Modifier and Type | Method and Description |
---|---|
protected void |
doInit() |
protected void |
doStart() |
protected void |
doStop() |
protected org.apache.camel.util.backoff.BackOff |
getBackOff(String id) |
long |
getBackOffDelay() |
long |
getBackOffMaxAttempts() |
long |
getBackOffMaxDelay() |
long |
getBackOffMaxElapsedTime() |
double |
getBackOffMultiplier() |
Collection<org.apache.camel.Route> |
getControlledRoutes() |
String |
getExcludeRoutes() |
Collection<org.apache.camel.Route> |
getExhaustedRoutes() |
String |
getIncludeRoutes() |
long |
getInitialDelay() |
Throwable |
getRestartException(String routeId) |
Collection<org.apache.camel.Route> |
getRestartingRoutes() |
org.apache.camel.util.backoff.BackOffTimer.Task |
getRestartingRouteState(String routeId) |
int |
getThreadPoolSize() |
boolean |
isUnhealthyOnExhausted() |
void |
resumeRoute(String routeId) |
void |
setBackOffDelay(long backOffDelay) |
void |
setBackOffMaxAttempts(long backOffMaxAttempts) |
void |
setBackOffMaxDelay(long backOffMaxDelay) |
void |
setBackOffMaxElapsedTime(long backOffMaxElapsedTime) |
void |
setBackOffMultiplier(double backOffMultiplier) |
void |
setExcludeRoutes(String excludeRoutes) |
void |
setIncludeRoutes(String includeRoutes) |
void |
setInitialDelay(long initialDelay) |
void |
setThreadPoolSize(int threadPoolSize) |
void |
setUnhealthyOnExhausted(boolean unhealthyOnExhausted) |
void |
startRoute(String routeId) |
void |
stopRoute(String routeId) |
void |
stopRoute(String routeId,
long timeout,
TimeUnit timeUnit) |
boolean |
stopRoute(String routeId,
long timeout,
TimeUnit timeUnit,
boolean abortAfterTimeout) |
void |
suspendRoute(String routeId) |
void |
suspendRoute(String routeId,
long timeout,
TimeUnit timeUnit) |
adapt, getCamelContext, getInternalRouteController, getRouteStartupLoggingLevel, getRouteStatus, isStartingRoutes, setCamelContext, setRouteStartupLoggingLevel, startAllRoutes, supervising
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
adapt, getRouteStartupLoggingLevel, getRouteStatus, isStartingRoutes, setRouteStartupLoggingLevel, startAllRoutes, supervising
getCamelContext, setCamelContext, trySetCamelContext
public String getIncludeRoutes()
getIncludeRoutes
in interface org.apache.camel.spi.SupervisingRouteController
public void setIncludeRoutes(String includeRoutes)
setIncludeRoutes
in interface org.apache.camel.spi.SupervisingRouteController
public String getExcludeRoutes()
getExcludeRoutes
in interface org.apache.camel.spi.SupervisingRouteController
public void setExcludeRoutes(String excludeRoutes)
setExcludeRoutes
in interface org.apache.camel.spi.SupervisingRouteController
public int getThreadPoolSize()
getThreadPoolSize
in interface org.apache.camel.spi.SupervisingRouteController
public void setThreadPoolSize(int threadPoolSize)
setThreadPoolSize
in interface org.apache.camel.spi.SupervisingRouteController
public long getInitialDelay()
getInitialDelay
in interface org.apache.camel.spi.SupervisingRouteController
public void setInitialDelay(long initialDelay)
setInitialDelay
in interface org.apache.camel.spi.SupervisingRouteController
public long getBackOffDelay()
getBackOffDelay
in interface org.apache.camel.spi.SupervisingRouteController
public void setBackOffDelay(long backOffDelay)
setBackOffDelay
in interface org.apache.camel.spi.SupervisingRouteController
public long getBackOffMaxDelay()
getBackOffMaxDelay
in interface org.apache.camel.spi.SupervisingRouteController
public void setBackOffMaxDelay(long backOffMaxDelay)
setBackOffMaxDelay
in interface org.apache.camel.spi.SupervisingRouteController
public long getBackOffMaxElapsedTime()
getBackOffMaxElapsedTime
in interface org.apache.camel.spi.SupervisingRouteController
public void setBackOffMaxElapsedTime(long backOffMaxElapsedTime)
setBackOffMaxElapsedTime
in interface org.apache.camel.spi.SupervisingRouteController
public long getBackOffMaxAttempts()
getBackOffMaxAttempts
in interface org.apache.camel.spi.SupervisingRouteController
public void setBackOffMaxAttempts(long backOffMaxAttempts)
setBackOffMaxAttempts
in interface org.apache.camel.spi.SupervisingRouteController
public double getBackOffMultiplier()
getBackOffMultiplier
in interface org.apache.camel.spi.SupervisingRouteController
public void setBackOffMultiplier(double backOffMultiplier)
setBackOffMultiplier
in interface org.apache.camel.spi.SupervisingRouteController
public boolean isUnhealthyOnExhausted()
isUnhealthyOnExhausted
in interface org.apache.camel.spi.SupervisingRouteController
public void setUnhealthyOnExhausted(boolean unhealthyOnExhausted)
setUnhealthyOnExhausted
in interface org.apache.camel.spi.SupervisingRouteController
protected org.apache.camel.util.backoff.BackOff getBackOff(String id)
protected void doInit() throws Exception
doInit
in class org.apache.camel.support.service.BaseService
Exception
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.service.BaseService
Exception
protected void doStop() throws Exception
doStop
in class org.apache.camel.support.service.BaseService
Exception
public void startRoute(String routeId) throws Exception
startRoute
in interface org.apache.camel.spi.RouteController
startRoute
in class DefaultRouteController
Exception
public void stopRoute(String routeId) throws Exception
stopRoute
in interface org.apache.camel.spi.RouteController
stopRoute
in class DefaultRouteController
Exception
public void stopRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
stopRoute
in interface org.apache.camel.spi.RouteController
stopRoute
in class DefaultRouteController
Exception
public boolean stopRoute(String routeId, long timeout, TimeUnit timeUnit, boolean abortAfterTimeout) throws Exception
stopRoute
in interface org.apache.camel.spi.RouteController
stopRoute
in class DefaultRouteController
Exception
public void suspendRoute(String routeId) throws Exception
suspendRoute
in interface org.apache.camel.spi.RouteController
suspendRoute
in class DefaultRouteController
Exception
public void suspendRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
suspendRoute
in interface org.apache.camel.spi.RouteController
suspendRoute
in class DefaultRouteController
Exception
public void resumeRoute(String routeId) throws Exception
resumeRoute
in interface org.apache.camel.spi.RouteController
resumeRoute
in class DefaultRouteController
Exception
public Collection<org.apache.camel.Route> getControlledRoutes()
getControlledRoutes
in interface org.apache.camel.spi.RouteController
getControlledRoutes
in class DefaultRouteController
public Collection<org.apache.camel.Route> getRestartingRoutes()
getRestartingRoutes
in interface org.apache.camel.spi.SupervisingRouteController
public Collection<org.apache.camel.Route> getExhaustedRoutes()
getExhaustedRoutes
in interface org.apache.camel.spi.SupervisingRouteController
public org.apache.camel.util.backoff.BackOffTimer.Task getRestartingRouteState(String routeId)
getRestartingRouteState
in interface org.apache.camel.spi.SupervisingRouteController
Apache Camel