public class SupervisingRouteController extends DefaultRouteController
RouteController that delays the startup
of the routes after the camel context startup and retries to start failing routes.
NOTE: this is experimental/unstable.| Modifier and Type | Class and Description |
|---|---|
static interface |
SupervisingRouteController.Filter |
static class |
SupervisingRouteController.FilterResult |
| Constructor and Description |
|---|
SupervisingRouteController() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFilter(SupervisingRouteController.Filter filter)
Add a filter used to determine the routes to supervise.
|
protected void |
doShutdown() |
protected void |
doStart() |
protected void |
doStop() |
org.apache.camel.util.backoff.BackOff |
getBackOff(String id) |
Map<String,org.apache.camel.util.backoff.BackOff> |
getBackOffConfigurations() |
Optional<org.apache.camel.util.backoff.BackOffTimer.Task> |
getBackOffContext(String id) |
Collection<org.apache.camel.Route> |
getControlledRoutes() |
org.apache.camel.util.backoff.BackOff |
getDefaultBackOff() |
Collection<SupervisingRouteController.Filter> |
getFilters() |
Duration |
getInitialDelay() |
void |
resumeRoute(String routeId) |
void |
setBackOff(String id,
org.apache.camel.util.backoff.BackOff backOff)
Sets the back-off to be applied to the given
id. |
void |
setBackOffConfigurations(Map<String,org.apache.camel.util.backoff.BackOff> backOffConfigurations)
Set the back-off for the given IDs.
|
void |
setDefaultBackOff(org.apache.camel.util.backoff.BackOff defaultBackOff)
Sets the default back-off.
|
void |
setFilters(Collection<SupervisingRouteController.Filter> filters)
Sets the filters user to determine the routes to supervise.
|
void |
setInitialDelay(Duration initialDelay)
Set the amount of time the route controller should wait before to start
the routes after the camel context is started or after the route is
initialized if the route is created after the camel context is started.
|
void |
setInitialDelay(long initialDelay)
#see
this#setInitialDelay(Duration) |
void |
setInitialDelay(long initialDelay,
TimeUnit initialDelayUnit)
#see
this#setInitialDelay(Duration) |
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) |
getCamelContext, getRouteStatus, isStartingRoutes, setCamelContext, startAllRoutesbuild, doBuild, doInit, doResume, doSuspend, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic org.apache.camel.util.backoff.BackOff getDefaultBackOff()
public void setDefaultBackOff(org.apache.camel.util.backoff.BackOff defaultBackOff)
public Map<String,org.apache.camel.util.backoff.BackOff> getBackOffConfigurations()
public void setBackOffConfigurations(Map<String,org.apache.camel.util.backoff.BackOff> backOffConfigurations)
public org.apache.camel.util.backoff.BackOff getBackOff(String id)
public void setBackOff(String id, org.apache.camel.util.backoff.BackOff backOff)
id.public Duration getInitialDelay()
public void setInitialDelay(Duration initialDelay)
initialDelay - the initial delay.public void setInitialDelay(long initialDelay,
TimeUnit initialDelayUnit)
this#setInitialDelay(Duration)initialDelay - the initial delay amount.public void setInitialDelay(long initialDelay)
this#setInitialDelay(Duration)initialDelay - the initial delay in milliseconds.public void addFilter(SupervisingRouteController.Filter filter)
public void setFilters(Collection<SupervisingRouteController.Filter> filters)
public Collection<SupervisingRouteController.Filter> getFilters()
public Optional<org.apache.camel.util.backoff.BackOffTimer.Task> getBackOffContext(String id)
protected void doStart()
throws Exception
doStart in class DefaultRouteControllerExceptionprotected void doStop()
throws Exception
doStop in class DefaultRouteControllerExceptionprotected void doShutdown()
throws Exception
doShutdown in class org.apache.camel.support.service.ServiceSupportExceptionpublic void startRoute(String routeId) throws Exception
startRoute in interface org.apache.camel.spi.RouteControllerstartRoute in class DefaultRouteControllerExceptionpublic void stopRoute(String routeId) throws Exception
stopRoute in interface org.apache.camel.spi.RouteControllerstopRoute in class DefaultRouteControllerExceptionpublic void stopRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
stopRoute in interface org.apache.camel.spi.RouteControllerstopRoute in class DefaultRouteControllerExceptionpublic boolean stopRoute(String routeId, long timeout, TimeUnit timeUnit, boolean abortAfterTimeout) throws Exception
stopRoute in interface org.apache.camel.spi.RouteControllerstopRoute in class DefaultRouteControllerExceptionpublic void suspendRoute(String routeId) throws Exception
suspendRoute in interface org.apache.camel.spi.RouteControllersuspendRoute in class DefaultRouteControllerExceptionpublic void suspendRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
suspendRoute in interface org.apache.camel.spi.RouteControllersuspendRoute in class DefaultRouteControllerExceptionpublic void resumeRoute(String routeId) throws Exception
resumeRoute in interface org.apache.camel.spi.RouteControllerresumeRoute in class DefaultRouteControllerExceptionpublic Collection<org.apache.camel.Route> getControlledRoutes()
getControlledRoutes in interface org.apache.camel.spi.RouteControllergetControlledRoutes in class DefaultRouteControllerApache Camel