Class ControlBusEndpoint
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultEndpoint
-
- org.apache.camel.component.controlbus.ControlBusEndpoint
-
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.CamelContextAware,org.apache.camel.Endpoint,org.apache.camel.IsSingleton,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasId,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="2.11.0", scheme="controlbus", title="Control Bus", syntax="controlbus:command:language", producerOnly=true, category={CORE,MONITORING}) public class ControlBusEndpoint extends org.apache.camel.support.DefaultEndpointManage and monitor Camel routes. For example, by sending a message to an Endpoint you can control the lifecycle of routes, or gather performance statistics.
-
-
Constructor Summary
Constructors Constructor Description ControlBusEndpoint(String endpointUri, org.apache.camel.Component component)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.ConsumercreateConsumer(org.apache.camel.Processor processor)org.apache.camel.ProducercreateProducer()protected voiddoInit()StringgetAction()ControlBusComponentgetComponent()org.apache.camel.spi.LanguagegetLanguage()org.apache.camel.LoggingLevelgetLoggingLevel()intgetRestartDelay()StringgetRouteId()booleanisAsync()voidsetAction(String action)To denote an action that can be either: start, stop, or status.voidsetAsync(boolean async)Whether to execute the control bus task asynchronously.voidsetLanguage(org.apache.camel.spi.Language language)Allows you to specify the name of a Language to use for evaluating the message body.voidsetLoggingLevel(org.apache.camel.LoggingLevel loggingLevel)Logging level used for logging when task is done, or if any exceptions occurred during processing the task.voidsetRestartDelay(int restartDelay)The delay in millis to use when restarting a route.voidsetRouteId(String routeId)To specify a route by its id.-
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doStart, doStop, equals, getCamelContext, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
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
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
ControlBusEndpoint
public ControlBusEndpoint(String endpointUri, org.apache.camel.Component component)
-
-
Method Detail
-
doInit
protected void doInit() throws Exception- Overrides:
doInitin classorg.apache.camel.support.DefaultEndpoint- Throws:
Exception
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception- Throws:
Exception
-
getComponent
public ControlBusComponent getComponent()
- Overrides:
getComponentin classorg.apache.camel.support.DefaultEndpoint
-
getLanguage
public org.apache.camel.spi.Language getLanguage()
-
setLanguage
public void setLanguage(org.apache.camel.spi.Language language)
Allows you to specify the name of a Language to use for evaluating the message body. If there is any result from the evaluation, then the result is put in the message body.
-
getRouteId
public String getRouteId()
-
setRouteId
public void setRouteId(String routeId)
To specify a route by its id. The special keyword "current" indicates the current route.
-
getAction
public String getAction()
-
setAction
public void setAction(String action)
To denote an action that can be either: start, stop, or status. To either start or stop a route, or to get the status of the route as output in the message body. You can use suspend and resume from Camel 2.11.1 onwards to either suspend or resume a route. And from Camel 2.11.1 onwards you can use stats to get performance statics returned in XML format; the routeId option can be used to define which route to get the performance stats for, if routeId is not defined, then you get statistics for the entire CamelContext. The restart action will restart the route.
-
getRestartDelay
public int getRestartDelay()
-
setRestartDelay
public void setRestartDelay(int restartDelay)
The delay in millis to use when restarting a route.
-
isAsync
public boolean isAsync()
-
setAsync
public void setAsync(boolean async)
Whether to execute the control bus task asynchronously. Important: If this option is enabled, then any result from the task is not set on the Exchange. This is only possible if executing tasks synchronously.
-
getLoggingLevel
public org.apache.camel.LoggingLevel getLoggingLevel()
-
setLoggingLevel
public void setLoggingLevel(org.apache.camel.LoggingLevel loggingLevel)
Logging level used for logging when task is done, or if any exceptions occurred during processing the task.
-
-