2 Home
gitea_admin edited this page 2026-03-11 14:37:45 +00:00

Exec

Execute commands on the underlying operating system.

Metadata

Property Value
Scheme exec
Support Level Stable
Labels core
Version 4.10.2

Maven Dependency

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-exec</artifactId>
    <version>4.10.2</version>
</dependency>

Endpoint Properties

Name Type Required Default Description
executable string Sets the executable to be executed. The executable must not be empty or null.
args string The arguments may be one or many whitespace-separated tokens.
binding object A reference to a org.apache.commons.exec.ExecBinding in the Registry.
commandExecutor object A reference to a org.apache.commons.exec.ExecCommandExecutor in the Registry that customizes the command execution. The default command executor utilizes the commons-exec library, which adds a shutdown hook for every executed command.
commandLogLevel object DEBUG Logging level to be used for commands during execution. The default value is DEBUG. Possible values are TRACE, DEBUG, INFO, WARN, ERROR or OFF. (Values of ExecCommandLogLevelType enum)
exitValues string The exit values of successful executions. If the process exits with another value, an exception is raised. Comma-separated list of exit values. And empty list (the default) sets no expected exit values and disables the check.
outFile string The name of a file, created by the executable, that should be considered as its output. If no outFile is set, the standard output (stdout) of the executable will be used instead.
timeout duration The timeout, in milliseconds, after which the executable should be terminated. If execution has not completed within the timeout, the component will send a termination request.
useStderrOnEmptyStdout boolean false A boolean indicating that when stdout is empty, this component will populate the Camel Message Body with stderr. This behavior is disabled (false) by default.
workingDir string The directory in which the command should be executed. If null, the working directory of the current process will be used.
lazyStartProducer boolean false Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.