Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
demoOne_camel_java_dsl
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();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.