#下面是官方文档的描述,在实践中遇到的官方文档中的一些坑,在下面会描述,话不多说直接开始。
创建route
public class MyFtpServerRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
// configure properties component
PropertiesComponent pc = getContext().getComponent("properties", PropertiesComponent.class);
pc.setLocation("classpath:application.properties");
// lets shutdown faster in case of in-flight messages stack up
getContext().getShutdownStrategy().setTimeout(10);
from("sftp://china_user@xxxx:2222/???/????autoCreate=false&username=china_user&password=123&passiveMode=true&binary=true")
.to("file:/Users/tanpeng/Documents/camel")
.log("Downloaded file ${file:name} complet