from( sftpServer ).to( downloadLocation ).log(LoggingLevel.INFO, logger, "Downloaded file ${file:name} complete."); } } 注意:要继承camel的RouteBulider,重写configure方法,大意是从ftp服务器下载文件到本地,并输出文件名(运行时所需必要信息都配置在application.properties文件中) 为了让java进程在后台运行...
delay=10s&move=done&readLock=rename route.parserfile.dir = {{ftp.local.dir}}/done camel.springboot.main-run-controller=true management.endpoint.camelroutes.enabled=true management.endpoint.camelroutes.read-only=true 四、启动类 packagecom.lvyuanj.core.camel;importorg.springframework.boot.Spring...
public class DownloadRoute extends RouteBuilder { /** logger */ private static final Logger logger = LoggerFactory.getLogger(DownloadRoute.class); @Value("${ftp.server.info}") private String sftpServer; @Value("${ftp.local.dir}") private String downloadLocation; @Autowired private DataProcessor...
from( sftpServer ).to( downloadLocation ).log(LoggingLevel.INFO, logger,"Downloaded file ${file:name} complete."); } } 注意:要继承camel的RouteBulider,重写configure方法,大意是从ftp服务器下载文件到本地,并输出文件名(运行时所需必要信息都配置在application.properties文件中) 为了让java进程在后台运行,...
*/@ComponentpublicclassFtpRouteBuilderextendsRouteBuilder{@Value("${ftp.img.url}")privateString sftpServerImg;@Value("${ftp.img.dir}")privateString downloadLocationImg;@Value("${ftp.file.url}")privateString sftpServerFile;@Value("${ftp.file.dir}")privateString downloadLocationFile;@Autowiredpriv...
从sftp文件夹下载所有文件后关闭sftpcamel路由 、、 我正在开发一个spring-boot应用程序,以便使用camelroute从sftp下载文件。以下是我的代码 from("sftp://username@host/folder") .process("processor").routeId(routeId); 我想在从给定的sftp文件夹下载所有< ...
1、Spring 中集成camel-ftp 1.1、POM引用 1.2、SpringBoot application.yml配置 1.3、配置路由 1.4、配置文件过滤 1.5、文件处理器 2、参考资料 1、Spring 中集成camel-ftp 近期项目中涉及到定期获取读取并解析ftp服务器上的文件,自己实现ftp-client的有些复杂,因此考虑集成camel-ftp的方式来解决ftp文件的下载...
@Overridepublicvoidconfigure()throwsException{// route1from(sftpServer).to(downloadLocation).process(dataProcessor).log(LoggingLevel.INFO,logger,"Download file ${file:name} complete.");// route2from(xxx).to(xxxx);// route3from(xxxx).to(xxx).process(xxx);} ...
@Overridepublic void configure() throws Exception{// route1from(sftpServer).to(downloadLocation).process(dataProcessor).log(LoggingLevel.INFO, logger, "Download file ${file:name} complete.");// route2from(xxx).to(xxxx);// route3from(xxxx).to(xxx).process(xxx); ...
I have a route (removing all the extra options to simplify) of from("sftp://servername:22?username=username&password=password&preferredAuthentications=password). pom.xml dependencies: Raw <dependency> <groupId>org.apache.camel.springboot</groupId> <artifactId>camel-ftp-starter</artifactId> </...