...
The exec
component can be used to execute a system command.
Dependencies
Maven users need to add the following dependency to their pom.xml
Code Block |
---|
|
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-exec</artifactId>
<version>${camel-version}</version>
</dependency>
|
where ${camel-version
} must be replaced by the actual version of Camel (2.3.0 or higher).
URI format
Code Block |
---|
|
exec://executable[?options]
|
...
Code Block |
---|
|
from("direct:exec")
.to("exec:ant.bat?args=-f CamelExecBuildFile.xml -l CamelExecOutFile.txt&outFile=CamelExecOutFile.txt")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
InputStream outFile = exchange.getIn().getBody(InputStream.class);
assertIsInstanceOf(InputStream.class, outFile);
// do something with the out file here
}
});
|
Dependencies
Maven users need to add the following dependency to their pom.xml
Code Block |
---|
|
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-exec</artifactId>
<version>${camel-version}</version>
</dependency>
|
...
Include Page |
---|
| CAMEL:Endpoint See Also |
---|
| CAMEL:Endpoint See Also |
---|
|