Created
December 4, 2012 11:53
-
-
Save hpirosha/4203018 to your computer and use it in GitHub Desktop.
demoOne_camel_java_dsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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