from("ftp://localhost") .to("file://localhost/output"); from("direct:readDatabase") .to("bean:databaseComponent?method=getData"); <camelContext> <route> <from uri="ftp://localhost"/> <to uri="file://localhost/output"/> </route> </camelContext> import org.apache.camel.CamelContext; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component ftp.FtpComponent; import org.apache.camel.component.file.FileComponent; import org.apache.camel.model.dataformat.JsonLibrary; public class MyRoute extends RouteBuilder { @Override public void configure() throws Exception { from("ftp://localhost") .to("file://localhost/output"); from("direct:readDatabase") .to("bean:databaseComponent?method=getData"); } } java -jar camel-2.16.0-all.jar


上一篇:
下一篇: