Class DefaultSupervisingRouteController

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.NonManagedService, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.RouteController, org.apache.camel.spi.SupervisingRouteController, org.apache.camel.StatefulService, org.apache.camel.StaticService, org.apache.camel.SuspendableService

    public class DefaultSupervisingRouteController
    extends DefaultRouteController
    implements org.apache.camel.spi.SupervisingRouteController
    A supervising capable 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.
    See Also:
    DefaultRouteController
    • Constructor Detail

      • DefaultSupervisingRouteController

        public DefaultSupervisingRouteController()
    • Method Detail

      • getIncludeRoutes

        public String getIncludeRoutes()
        Specified by:
        getIncludeRoutes in interface org.apache.camel.spi.SupervisingRouteController
      • setIncludeRoutes

        public void setIncludeRoutes​(String includeRoutes)
        Specified by:
        setIncludeRoutes in interface org.apache.camel.spi.SupervisingRouteController
      • getExcludeRoutes

        public String getExcludeRoutes()
        Specified by:
        getExcludeRoutes in interface org.apache.camel.spi.SupervisingRouteController
      • setExcludeRoutes

        public void setExcludeRoutes​(String excludeRoutes)
        Specified by:
        setExcludeRoutes in interface org.apache.camel.spi.SupervisingRouteController
      • getThreadPoolSize

        public int getThreadPoolSize()
        Specified by:
        getThreadPoolSize in interface org.apache.camel.spi.SupervisingRouteController
      • setThreadPoolSize

        public void setThreadPoolSize​(int threadPoolSize)
        Specified by:
        setThreadPoolSize in interface org.apache.camel.spi.SupervisingRouteController
      • getInitialDelay

        public long getInitialDelay()
        Specified by:
        getInitialDelay in interface org.apache.camel.spi.SupervisingRouteController
      • setInitialDelay

        public void setInitialDelay​(long initialDelay)
        Specified by:
        setInitialDelay in interface org.apache.camel.spi.SupervisingRouteController
      • getBackOffDelay

        public long getBackOffDelay()
        Specified by:
        getBackOffDelay in interface org.apache.camel.spi.SupervisingRouteController
      • setBackOffDelay

        public void setBackOffDelay​(long backOffDelay)
        Specified by:
        setBackOffDelay in interface org.apache.camel.spi.SupervisingRouteController
      • getBackOffMaxDelay

        public long getBackOffMaxDelay()
        Specified by:
        getBackOffMaxDelay in interface org.apache.camel.spi.SupervisingRouteController
      • setBackOffMaxDelay

        public void setBackOffMaxDelay​(long backOffMaxDelay)
        Specified by:
        setBackOffMaxDelay in interface org.apache.camel.spi.SupervisingRouteController
      • getBackOffMaxElapsedTime

        public long getBackOffMaxElapsedTime()
        Specified by:
        getBackOffMaxElapsedTime in interface org.apache.camel.spi.SupervisingRouteController
      • setBackOffMaxElapsedTime

        public void setBackOffMaxElapsedTime​(long backOffMaxElapsedTime)
        Specified by:
        setBackOffMaxElapsedTime in interface org.apache.camel.spi.SupervisingRouteController
      • getBackOffMaxAttempts

        public long getBackOffMaxAttempts()
        Specified by:
        getBackOffMaxAttempts in interface org.apache.camel.spi.SupervisingRouteController
      • setBackOffMaxAttempts

        public void setBackOffMaxAttempts​(long backOffMaxAttempts)
        Specified by:
        setBackOffMaxAttempts in interface org.apache.camel.spi.SupervisingRouteController
      • getBackOffMultiplier

        public double getBackOffMultiplier()
        Specified by:
        getBackOffMultiplier in interface org.apache.camel.spi.SupervisingRouteController
      • setBackOffMultiplier

        public void setBackOffMultiplier​(double backOffMultiplier)
        Specified by:
        setBackOffMultiplier in interface org.apache.camel.spi.SupervisingRouteController
      • isUnhealthyOnExhausted

        public boolean isUnhealthyOnExhausted()
        Specified by:
        isUnhealthyOnExhausted in interface org.apache.camel.spi.SupervisingRouteController
      • setUnhealthyOnExhausted

        public void setUnhealthyOnExhausted​(boolean unhealthyOnExhausted)
        Specified by:
        setUnhealthyOnExhausted in interface org.apache.camel.spi.SupervisingRouteController
      • getBackOff

        protected org.apache.camel.util.backoff.BackOff getBackOff​(String id)
      • doInit

        protected void doInit()
                       throws Exception
        Overrides:
        doInit in class org.apache.camel.support.service.BaseService
        Throws:
        Exception
      • doStart

        protected void doStart()
                        throws Exception
        Overrides:
        doStart in class org.apache.camel.support.service.BaseService
        Throws:
        Exception
      • doStop

        protected void doStop()
                       throws Exception
        Overrides:
        doStop in class org.apache.camel.support.service.BaseService
        Throws:
        Exception
      • getRestartingRoutes

        public Collection<org.apache.camel.Route> getRestartingRoutes()
        Specified by:
        getRestartingRoutes in interface org.apache.camel.spi.SupervisingRouteController
      • getExhaustedRoutes

        public Collection<org.apache.camel.Route> getExhaustedRoutes()
        Specified by:
        getExhaustedRoutes in interface org.apache.camel.spi.SupervisingRouteController
      • getRestartingRouteState

        public org.apache.camel.util.backoff.BackOffTimer.Task getRestartingRouteState​(String routeId)
        Specified by:
        getRestartingRouteState in interface org.apache.camel.spi.SupervisingRouteController
      • getRestartException

        public Throwable getRestartException​(String routeId)
        Specified by:
        getRestartException in interface org.apache.camel.spi.SupervisingRouteController