/** * Lets configure the Camel routing rules using Java code... */ public void configure() { // TODO create Camel routes here. // here is a sample which processes the input files // (leaving them in place - see the 'noop' flag) // then performs content based routing on the message // using XPath from("file:src/data?noop=true"). choice(). when(xpath("/person/city = 'London'")).to("file:target/messages/uk"). otherwise().to("file:target/messages/others"); } }
/** * Lets configure the Camel routing rules using Java code... */ public void configure() { // TODO create Camel routes here. // here is a sample which processes the input files // (leaving them in place - see the 'noop' flag) // then performs content based routing on the message // using XPath from("file:src/data?noop=true"). choice(). when(xpath("/person/city = 'London'")).to("file:target/messages/uk"). otherwise().to("file:target/messages/others"); } }
/** * Let's configure the Camel routing rules using Java code... */ public void configure() { // here is a sample which processes the input files // (leaving them in place - see the 'noop' flag) // then performs content based routing on the message using XPath from("file:src/data?noop=true&recusive=true") .choice() .when(xpath("/person/city = 'London'")) .to("log:uk?showall=true") .to("file:target/messages/uk") .otherwise() .to("file:target/messages/others"); }
public void configure() { from("timer:foo?period=5000&synchronous=true") .transform(simple("${random(1000)}")) .choice() .when(simple("${body} > 500")) .log("High number ${body}") .to("mock:high") .otherwise() .log("Low number ${body}") .to("mock:low"); }