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.ComponentAware,org.apache.camel.Endpoint,org.apache.camel.IsSingleton,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasCamelContext,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.DefaultEndpoint
Manage and monitor Camel routes.
For example, by sending a message to an Endpoint you can control the lifecycle of routes, or gather performance
statistics.
-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
ConstructorsConstructorDescriptionControlBusEndpoint(String endpointUri, org.apache.camel.Component component) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.ConsumercreateConsumer(org.apache.camel.Processor processor) org.apache.camel.Producerprotected voiddoInit()org.apache.camel.spi.Languageorg.apache.camel.LoggingLevelintbooleanisAsync()voidTo 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, 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, toStringMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.ComponentAware
getComponentMethods inherited from interface org.apache.camel.Endpoint
getEndpointBaseUri, isSingletonProducerMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
ControlBusEndpoint
-
-
Method Details
-
doInit
- Overrides:
doInitin classorg.apache.camel.support.DefaultEndpoint- Throws:
Exception
-
createProducer
- Throws:
Exception
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception - Throws:
Exception
-
getComponent
- Specified by:
getComponentin interfaceorg.apache.camel.ComponentAware- 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
-
setRouteId
To specify a route by its id. The special keyword "current" indicates the current route. -
getAction
-
setAction
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 to either suspend or resume a route. 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. And the fail action will stop and mark the route as failed (stopped due to an exception) -
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.
-