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 Details

  • Method Details

    • end

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • 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

      public String getIncludeRoutes()
    • setIncludeRoutes

      public void setIncludeRoutes(String includeRoutes)
      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

      public String getExcludeRoutes()
    • setExcludeRoutes

      public void setExcludeRoutes(String excludeRoutes)
      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

      public RouteControllerConfigurationProperties 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. 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

      public RouteControllerConfigurationProperties withInitialDelay(long initialDelay)
      Initial delay in milli seconds before the route controller starts, after CamelContext has been started.
    • withBackOffDelay

      public RouteControllerConfigurationProperties withBackOffDelay(long backOffDelay)
      Backoff delay in millis when restarting a route that failed to startup.
    • withBackOffMaxDelay

      public RouteControllerConfigurationProperties withBackOffMaxDelay(long backOffMaxDelay)
      Backoff maximum delay in millis when restarting a route that failed to startup.
    • withBackOffMaxElapsedTime

      public RouteControllerConfigurationProperties withBackOffMaxElapsedTime(long backOffMaxElapsedTime)
      Backoff maximum elapsed time in millis, after which the backoff should be considered exhausted and no more attempts should be made.
    • withBackOffMaxAttempts

      public RouteControllerConfigurationProperties withBackOffMaxAttempts(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.
    • withBackOffMultiplier

      public RouteControllerConfigurationProperties withBackOffMultiplier(double backOffMultiplier)
      Backoff multiplier to use for exponential backoff. This is used to extend the delay between restart attempts.
    • withThreadPoolSize

      public RouteControllerConfigurationProperties withThreadPoolSize(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.
    • withIncludeRoutes

      public RouteControllerConfigurationProperties withIncludeRoutes(String includeRoutes)
      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

      public RouteControllerConfigurationProperties withExcludeRoutes(String excludeRoutes)
      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.