public
Last active

demoOne_camel_java_dsl

  • Download Gist
JavaDSLMain
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
package org.nsinfra.camel;
 
import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
 
public class JavaDSLMain extends RouteBuilder {
 
/**
* {@link RouteBuilder#configure()}
* Specifies route definition
*/
@Override
public void configure() throws Exception {
from("activemq:queue:NewOrders?brokerURL=tcp://192.168.64.144:61616")
.choice().when(xpath("/order/product = 'gadget'"))
.to("activemq:queue:GadgetOrders?brokerURL=tcp://192.168.64.144:61616")
.otherwise()
.to("ftp://192.168.101.3/camel-demo?username=admin&password=admin&binary=true");
}
 
public static void main(String[] args) throws Exception {
CamelContext camelContext = new DefaultCamelContext();
camelContext.addRoutes(new JavaDSLMain());
camelContext.start();
/* wait indefinitely */
Object obj = new Object();
synchronized (obj) {
obj.wait();
}
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.