I have the following spring configuration
<?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>
On the ftp side, I have 3 folders with files that I want to download. I want to run the following script:
- On ftp, a fixed number of files (for isntance 5) from the first data transfer user uploads these files to the destination folder
- On the second attempt to upload files, the ftp state remains the same (5 files), and the ftp camel consumer simply does nothing (except checking for new files).
- 2 new files come to ftp, and with this pull data, the consumer downloads only these new two files
Currently my current solutions download all the files every time I start the dataload process, how can I manage the information about the downloaded files to prevent duplicates from downloading (I mean the files already copied from ftp), I can write my own filter, which will filter out already downloaded files, but I believe that there should be a built-in function that will give me control over this (maybe idempotentRepository, actually I'm not sure) ...
source share