Control Bus

Control Bus

Scheme: controlbus
Syntax: controlbus:command:language
Description: The controlbus component provides easy management of Camel applications based on the Control Bus EIP pattern.
Deprecated:false
Maven: org.apache.camel/camel-core/2.17.0.redhat-630224

The controlbus component provides easy management of Camel applications based on the Control Bus EIP pattern. For example, by sending a message to an Endpoint you can control the lifecycle of routes, or gather performance statistics.

Name Kind Group Required Default Type Enum Description
command path producer true java.lang.String route
language
Command can be either route or language
language path producer org.apache.camel.spi.Language bean
constant
el
exchangeProperty
file
groovy
header
jsonpath
jxpath
mvel
ognl
ref
simple
spel
sql
terser
tokenize
xpath
xquery
xtokenize
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.
bridgeErrorHandler parameter consumer boolean Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler.

By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN/ERROR level and ignored.

exceptionHandler parameter consumer (advanced) org.apache.camel.spi.ExceptionHandler To let the consumer use a custom ExceptionHandler. + Notice if the option bridgeErrorHandler is enabled then this options is not in use. + By default the consumer will deal with exceptions, that will be logged at WARN/ERROR level and ignored.
action parameter producer java.lang.String start
stop
suspend
resume
status
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.

async parameter producer boolean 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.

loggingLevel parameter producer INFO org.apache.camel.LoggingLevel TRACE
DEBUG
INFO
WARN
ERROR
OFF
Logging level used for logging when task is done, or if any exceptions occurred during processing the task.
routeId parameter producer java.lang.String To specify a route by its id. The special keyword "current" indicates the current route.
exchangePattern parameter advanced InOnly org.apache.camel.ExchangePattern InOnly
RobustInOnly
InOut
InOptionalOut
OutOnly
RobustOutOnly
OutIn
OutOptionalIn
Sets the default exchange pattern when creating an exchange.
synchronous parameter advanced false boolean Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). @param synchronous true to enforce synchronous processing