Hi Yeah that strategy used by good old mainframes? Easier to write a new filer rather than rename/move the actual file.
Camel can do this but it would require a little additional coding as you need to implement your own process strategy. With 2.0m2 you implement you own GenericFileProcessStrategy interface. And in the begin method you use the listFiles() method on the operations to see if the "complete.txt" file is there. Return true | false depending on the file exists. In the commit operation you move the actual file and delete the complete.txt file. The operations interface have methods for that. The only issue I see is that the file consumer will log WARN if begin returns false. I think we should reduce that to DEBUG as it is a valid strategy for you. I will do that in my next commit. On Sat, Jun 27, 2009 at 12:26 PM, CY Kan<[email protected]> wrote: > > Hi, > > I'm trying Camel 2.0-M2 and can't figure out how to realize the scenario > below: > > 1. System A exports records to a file named records.txt in an sftp server > folder. > 2. to avoid read/write concurrency issue, System A creates another file > named "completed" in the folder after records.txt is made. In other words, > seeing "completed" means ready for file download. > 3. System B polls the sftp server folder for "completed". > 4. If "completed" is found, System B donwloads records.txt. > 5. System B archives records.txt in another folder and deletes "completed" > after download complete. > > I think it's something like Aggregator + Filter but failed. The problem is > the download of records.txt needs postponed until "completed" is found. > Could you suggest if Camel is good at this sort of thing or any other idea? > > Thank you in advance. > -- > View this message in context: > http://www.nabble.com/SFTP-Handshake-tp24232050p24232050.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
