Exec
Execute commands on the underlying operating system.
What’s inside
-
Exec component, URI syntax:
exec:executable
Please refer to the above links for usage and configuration details.
Maven coordinates
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-exec-starter</artifactId>
</dependency> Spring Boot Auto-Configuration
The starter supports 8 options, which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
camel.component.exec.allow-control-headers | Whether to allow to use Camel headers or not (default false). Enabling this allows to specify dynamic command line arguments via message header. However this can be seen as a potential security vulnerability if the header is coming from a malicious user, so use this with care. | false | Boolean |
camel.component.exec.autowired-enabled | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | Boolean |
camel.component.exec.binding | To use a custom org.apache.commons.exec.ExecBinding for advanced use-cases. The option is a org.apache.camel.component.exec.ExecBinding type. | ExecBinding | |
camel.component.exec.command-executor | To use a custom org.apache.commons.exec.ExecCommandExecutor that customizes the command execution. The default command executor utilizes the commons-exec library, which adds a shutdown hook for every executed command. The option is a org.apache.camel.component.exec.ExecCommandExecutor type. | ExecCommandExecutor | |
camel.component.exec.enabled | Whether to enable auto configuration of the exec component. This is enabled by default. | Boolean | |
camel.component.exec.lazy-start-producer | 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. | false | Boolean |
camel.component.exec.timeout | 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. | Long | |
camel.component.exec.working-dir | The directory in which the command should be executed. If null, the working directory of the current process will be used. | String |