Hi Its better if when uploading the files they are uploaded using a temporary name and then renamed when done. eg if the network fails during upload then you know the file is not complete. If you dont do this, you can essentially have broken files.
However if you know that a file is complete if its been there for 10 seconds, then you can write your own custom read lock strategy that keeps track of this and then returns true in those situations. On Fri, Mar 20, 2020 at 1:17 AM Mark Harris <[email protected]> wrote: > > > Its been talked about before, that changed read-locks on FTP servers is not > > "so fast" because FTP server > > often returns file information / file lists with only hh:mm information and > > not seconds, so a change > > strategy cannot use seconds to know if a file was changed or not. > > Is there an alternative strategy that I can use? > > The scenario is that I have two applications polling an sFTP server for new > files every 30 seconds; any new file needs to be at least 10 seconds old, > picked up as soon as possible after this period and processed by only one of > the applications. > > I'm currently using readLock=changed, a readLockMinAge and an > inProgressRepository to ensure idempotency in my route URI. > > Thanks, > > Mark -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2
