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();
	}

}

你可能感兴趣的:(apache,helloworld,demo,例子,camel)