Package org.apache.camel.main
Class RouteControllerConfigurationProperties
java.lang.Object
org.apache.camel.main.RouteControllerConfigurationProperties
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.camel.spi.BootstrapCloseable
@Configurer(bootstrap=true)
public class RouteControllerConfigurationProperties
extends Object
implements org.apache.camel.spi.BootstrapCloseable
Route controller configuration.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
end()
long
long
long
long
double
long
int
boolean
boolean
boolean
void
setBackOffDelay
(long backOffDelay) Backoff delay in millis when restarting a route that failed to startup.void
setBackOffMaxAttempts
(long backOffMaxAttempts) Backoff maximum number of attempts to restart a route that failed to startup.void
setBackOffMaxDelay
(long backOffMaxDelay) Backoff maximum delay in millis when restarting a route that failed to startup.void
setBackOffMaxElapsedTime
(long backOffMaxElapsedTime) Backoff maximum elapsed time in millis, after which the backoff should be considered exhausted and no more attempts should be made.void
setBackOffMultiplier
(double backOffMultiplier) Backoff multiplier to use for exponential backoff.void
setEnabled
(boolean enabled) To enable using supervising route controller which allows Camel to startup and then the controller takes care of starting the routes in a safe manner.void
setExcludeRoutes
(String excludeRoutes) Pattern for filtering routes to be excluded as supervised.void
setIncludeRoutes
(String includeRoutes) Pattern for filtering routes to be included as supervised.void
setInitialDelay
(long initialDelay) Initial delay in milli seconds before the route controller starts, after CamelContext has been started.void
setThreadPoolSize
(int threadPoolSize) The number of threads used by the route controller scheduled thread pool that are used for restarting routes.void
setUnhealthyOnExhausted
(boolean unhealthyOnExhausted) Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is not successfully started and the route manager is giving up.void
setUnhealthyOnRestarting
(boolean unhealthyOnRestarting) Whether to mark the route as unhealthy (down) when the route failed to initially start, and is being controlled for restarting (backoff).withBackOffDelay
(long backOffDelay) Backoff delay in millis when restarting a route that failed to startup.withBackOffMaxAttempts
(long backOffMaxAttempts) Backoff maximum number of attempts to restart a route that failed to startup.withBackOffMaxDelay
(long backOffMaxDelay) Backoff maximum delay in millis when restarting a route that failed to startup.withBackOffMaxElapsedTime
(long backOffMaxElapsedTime) Backoff maximum elapsed time in millis, after which the backoff should be considered exhausted and no more attempts should be made.withBackOffMultiplier
(double backOffMultiplier) Backoff multiplier to use for exponential backoff.withEnabled
(boolean enabled) To enable using supervising route controller which allows Camel to startup and then the controller takes care of starting the routes in a safe manner.withExcludeRoutes
(String excludeRoutes) Pattern for filtering routes to be excluded as supervised.withIncludeRoutes
(String includeRoutes) Pattern for filtering routes to be included as supervised.withInitialDelay
(long initialDelay) Initial delay in milli seconds before the route controller starts, after CamelContext has been started.withThreadPoolSize
(int threadPoolSize) The number of threads used by the route controller scheduled thread pool that are used for restarting routes.withUnhealthyOnExhausted
(boolean unhealthyOnExhausted) Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is not successfully started and the route manager is giving up.withUnhealthyOnRestarting
(boolean unhealthyOnRestarting) Whether to mark the route as unhealthy (down) when the route failed to initially start, and is being controlled for restarting (backoff).
-
Constructor Details
-
RouteControllerConfigurationProperties
-
-
Method Details
-
end
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) To enable using supervising route controller which allows Camel to startup and then the controller takes care of starting the routes in a safe manner. This can be used when you want to startup Camel despite a route may otherwise fail fast during startup and cause Camel to fail to startup as well. By delegating the route startup to the supervising route controller then its manages the startup using a background thread. The controller allows to be configured with various settings to attempt to restart failing routes. -
getIncludeRoutes
-
setIncludeRoutes
Pattern for filtering routes to be included as supervised. The pattern is matching on route id, and endpoint uri for the route. Multiple patterns can be separated by comma. For example to include all kafka routes, you can say kafka:*. And to include routes with specific route ids myRoute,myOtherRoute. The pattern supports wildcards and uses the matcher from org.apache.camel.support.PatternHelper#matchPattern. -
getExcludeRoutes
-
setExcludeRoutes
Pattern for filtering routes to be excluded as supervised. The pattern is matching on route id, and endpoint uri for the route. Multiple patterns can be separated by comma. For example to exclude all JMS routes, you can say jms:*. And to exclude routes with specific route ids mySpecialRoute,myOtherSpecialRoute. The pattern supports wildcards and uses the matcher from org.apache.camel.support.PatternHelper#matchPattern. -
getThreadPoolSize
public int getThreadPoolSize() -
setThreadPoolSize
public void setThreadPoolSize(int threadPoolSize) The number of threads used by the route controller scheduled thread pool that are used for restarting routes. The pool uses 1 thread by default, but you can increase this to allow the controller to concurrently attempt to restart multiple routes in case more than one route has problems starting. -
getInitialDelay
public long getInitialDelay() -
setInitialDelay
public void setInitialDelay(long initialDelay) Initial delay in milli seconds before the route controller starts, after CamelContext has been started. -
getBackOffDelay
public long getBackOffDelay() -
setBackOffDelay
public void setBackOffDelay(long backOffDelay) Backoff delay in millis when restarting a route that failed to startup. -
getBackOffMaxDelay
public long getBackOffMaxDelay() -
setBackOffMaxDelay
public void setBackOffMaxDelay(long backOffMaxDelay) Backoff maximum delay in millis when restarting a route that failed to startup. -
getBackOffMaxElapsedTime
public long getBackOffMaxElapsedTime() -
setBackOffMaxElapsedTime
public void setBackOffMaxElapsedTime(long backOffMaxElapsedTime) Backoff maximum elapsed time in millis, after which the backoff should be considered exhausted and no more attempts should be made. -
getBackOffMaxAttempts
public long getBackOffMaxAttempts() -
setBackOffMaxAttempts
public void setBackOffMaxAttempts(long backOffMaxAttempts) Backoff maximum number of attempts to restart a route that failed to startup. When this threshold has been exceeded then the controller will give up attempting to restart the route, and the route will remain as stopped. -
getBackOffMultiplier
public double getBackOffMultiplier() -
setBackOffMultiplier
public void setBackOffMultiplier(double backOffMultiplier) Backoff multiplier to use for exponential backoff. This is used to extend the delay between restart attempts. -
isUnhealthyOnExhausted
public boolean isUnhealthyOnExhausted() -
setUnhealthyOnExhausted
public void setUnhealthyOnExhausted(boolean unhealthyOnExhausted) Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is not successfully started and the route manager is giving up. Setting this to true allows health checks to know about this and can report the Camel application as DOWN. The default is false. -
isUnhealthyOnRestarting
public boolean isUnhealthyOnRestarting() -
setUnhealthyOnRestarting
public void setUnhealthyOnRestarting(boolean unhealthyOnRestarting) Whether to mark the route as unhealthy (down) when the route failed to initially start, and is being controlled for restarting (backoff). Setting this to true allows health checks to know about this and can report the Camel application as DOWN. The default is false. -
withEnabled
To enable using supervising route controller which allows Camel to startup and then the controller takes care of starting the routes in a safe manner. This can be used when you want to startup Camel despite a route may otherwise fail fast during startup and cause Camel to fail to startup as well. By delegating the route startup to the supervising route controller then its manages the startup using a background thread. The controller allows to be configured with various settings to attempt to restart failing routes. -
withInitialDelay
Initial delay in milli seconds before the route controller starts, after CamelContext has been started. -
withBackOffDelay
Backoff delay in millis when restarting a route that failed to startup. -
withBackOffMaxDelay
Backoff maximum delay in millis when restarting a route that failed to startup. -
withBackOffMaxElapsedTime
Backoff maximum elapsed time in millis, after which the backoff should be considered exhausted and no more attempts should be made. -
withBackOffMaxAttempts
Backoff maximum number of attempts to restart a route that failed to startup. When this threshold has been exceeded then the controller will give up attempting to restart the route, and the route will remain as stopped. -
withBackOffMultiplier
Backoff multiplier to use for exponential backoff. This is used to extend the delay between restart attempts. -
withThreadPoolSize
The number of threads used by the route controller scheduled thread pool that are used for restarting routes. The pool uses 1 thread by default, but you can increase this to allow the controller to concurrently attempt to restart multiple routes in case more than one route has problems starting. -
withIncludeRoutes
Pattern for filtering routes to be included as supervised. The pattern is matching on route id, and endpoint uri for the route. Multiple patterns can be separated by comma. For example to include all kafka routes, you can say kafka:*. And to include routes with specific route ids myRoute,myOtherRoute. The pattern supports wildcards and uses the matcher from org.apache.camel.support.PatternHelper#matchPattern. -
withExcludeRoutes
Pattern for filtering routes to be excluded as supervised. The pattern is matching on route id, and endpoint uri for the route. Multiple patterns can be separated by comma. For example to exclude all JMS routes, you can say jms:*. And to exclude routes with specific route ids mySpecialRoute,myOtherSpecialRoute. The pattern supports wildcards and uses the matcher from org.apache.camel.support.PatternHelper#matchPattern. -
withUnhealthyOnExhausted
public RouteControllerConfigurationProperties withUnhealthyOnExhausted(boolean unhealthyOnExhausted) Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is not successfully started and the route manager is giving up. Setting this to true allows health checks to know about this and can report the Camel application as DOWN. The default is false. -
withUnhealthyOnRestarting
public RouteControllerConfigurationProperties withUnhealthyOnRestarting(boolean unhealthyOnRestarting) Whether to mark the route as unhealthy (down) when the route failed to initially start, and is being controlled for restarting (backoff). Setting this to true allows health checks to know about this and can report the Camel application as DOWN. The default is false.
-