Hello,

I have adapted the « exec » example shown on the 
http://camel.apache.org/exec.html page, as follows.

Unfortunately, nothing appears on the console.

Why is that?

Many thanks.

Philippe


from("direct:exec")
.to("exec:/usr/bin/java?args=-server -version")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
// By default, the body is ExecResult instance
// assertIsInstanceOf(ExecResult.class, exchange.getIn().getBody());
// Use the Camel Exec String type converter to convert the ExecResult to String
// In this case, the stdout is considered as output
                                
Object obj = exchange.getIn().getBody();
Object obj1 = exchange.getIn().getHeader(ExecBinding.EXEC_EXIT_VALUE);
System.out.println("obj = " + obj);
System.out.println("obj1 = " + obj1);
}
})
.to("stream:out");

Reply via email to