`

Apache Camel HelloWorld

阅读更多
程序的运行结果是将C:/data/inbox目录下所有的文件,复制到C:/data/outbox下。

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;

public class HelloCamel {
	public static void main(String args[]) throws Exception {
		CamelContext context = new DefaultCamelContext();
		context.addRoutes(new RouteBuilder() {
			public void configure() {
				from("file:C:/data/inbox?noop=true").to("file:C:/data/outbox");
			}
		});
		context.start();
		Thread.sleep(10000);
		context.stop();
	}

}

分享到:
评论
2 楼 javapub 2013-02-22  
wsxssgg 写道
请问 ?noop=true 是什么意思

noop, If true, the file is not moved or deleted in any way. This option is good for readonly data, or for ETL type requirements. If noop=true, Camel will set idempotent=true as well, to avoid consuming the same files over and over again.
具体可以参考这里:
http://camel.apache.org/file2.html
1 楼 wsxssgg 2012-08-24  
请问 ?noop=true 是什么意思

相关推荐

Global site tag (gtag.js) - Google Analytics