标签:
1 new RouteBuilder() { 2 @Override 3 public void configure() throws Exception { 4 from("amqp:queue:incoming").to("log:com.mycompany.log?level=DEBUG"); 5 from("rabbitmq://localhost/A/routingKey=B").to("log:com.mycompany.log?level=DEBUG"); 6 from("jetty:http://localhost:8080/myapp/myservice").to("log:com.mycompany.log?level=DEBUG"); 7 } 8 }
from表示从这个endpoing取消息,to表示将消息发往这个endpoint,endpoint是消息地址,包含协议类型以及url。
from("amqp:queue:order").process(new XmlToJsonProcessor()).to("bean:orderHandler");
<route> <from uri="amqp:queue:order"/> <multicast> <to uri="uri:validateBean"/> <to uri="uri:handleBean"/> <to uri="uri:emailBean"/> </multicast> </route>
<route> <from uri="amqp:queue:order"/> <multicast> <to uri="uri:validateBean"/> <to uri="uri:handleBean"/> <to uri="log:com.mycompany.log?level=INFO"/> <to uri="uri:emailBean"/> </multicast> </route>
from("amqp:queue:order").filter(header("foo").isEqualTo("bar")).choice() .when(xpath("/person/city = 'London'")) .to("file:target/messages/uk") .otherwise() .to("file:target/messages/others");
标签:
原文地址:http://www.cnblogs.com/zengbiaobiao2016/p/5480992.html