RouteBuilder myBuilder = new MyRouteBuilder(); myBuilder.setOrderHandler(new DummyOrderHandler()); ...
/** * 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"); }
/** * A main() so we can easily run these routing rules in our IDE */ public static void main(String... args) throws Exception { Main main = new Main(); main.addRouteBuilder(new MyRouteBuilder()); main.run(args); }
/** * A main() so we can easily run these routing rules in our IDE */ public static void main(String... args) throws Exception { Main main = new Main(); main.addRouteBuilder(new MyRouteBuilder()); main.run(args); }
public static void main(String args[]) throws Exception { // create CamelContext CamelContext context = new DefaultCamelContext(); // add our route to the CamelContext context.addRoutes(new MyRouteBuilder()); // start the route and let it do its work context.start(); Thread.sleep(10000); // stop the CamelContext context.stop(); } }