end*_*yha 6 java ftp apache-camel
我有以下弹簧配置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="downloadLogger" class="com.thomsonreuters.oa.sdi.camel.DownloadLogger" />
<bean id="fileFilter" class="com.thomsonreuters.oa.sdi.camel.IgnoreReadyFilesFilter" />
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="ftp://url_to_ftp?password=*******&noop=true&stepwise=false&binary=true&consumer.delay=10s&recursive=true&filter=#fileFilter" />
<process ref="downloadLogger" />
<to uri="file:data/outbox" />
</route>
</camelContext>
</beans>
Run Code Online (Sandbox Code Playgroud)
在ftp方面,我有3个文件夹,包含我要下载的文件.我想实现以下场景:
目前,当我运行dataload进程时,我的当前解决方案每次下载所有文件,我如何管理有关下载文件的信息以防止重复下载(我的意思是已经从ftp复制了文件),我可以编写自己的过滤器,它将过滤掉已经下载的文件,但我相信应该有内置的功能,这将给我控制这个(也许是idempotentRepository,实际上我不确定)...
Cla*_*sen 12
如果希望Camel能够在重新启动之间记住以前下载的文件,则需要使用持久性幂等存储库.
您需要在ftp端点上设置此选项:idempotentRepository
请在此处查看更多详细信息:http://camel.apache.org/file2 (注意:FTP组件从文件组件继承选项.)
维基页面上有一些示例如何使用不同的商店.您还可以构建自定义商店.
| 归档时间: |
|
| 查看次数: |
10744 次 |
| 最近记录: |