2012-07-15 14:12:03 +02:00
|
|
|
package docs.camel.sample.route;
|
|
|
|
|
|
|
|
|
|
//#CustomRouteExample
|
|
|
|
|
import org.apache.camel.Exchange;
|
|
|
|
|
import org.apache.camel.Processor;
|
|
|
|
|
import org.apache.camel.builder.RouteBuilder;
|
|
|
|
|
|
|
|
|
|
public class CustomRouteBuilder extends RouteBuilder{
|
|
|
|
|
public void configure() throws Exception {
|
|
|
|
|
from("direct:welcome").process(new Processor(){
|
|
|
|
|
public void process(Exchange exchange) throws Exception {
|
2012-10-01 20:35:19 +02:00
|
|
|
exchange.getOut().setBody(String.format("Welcome %s",
|
|
|
|
|
exchange.getIn().getBody()));
|
2012-07-15 14:12:03 +02:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//#CustomRouteExample
|