Oct 10th, 2011, 01:55 AM
Don't want to process incomplete file
I have file inbound adaptor which reads the file from directory.I am having a tool which right the files to this directory.I don't want to pick those file which has not been written in directory means tool is still writing a file it might take couple of milliseconds to completely write this file.Is there any way in SI to know that this file is under process and read it only when it's writting is complete.
directory="C:\\Documents and Settings\\510122\\workspace\\OdsBatch\\Abnitio"
id="picker_abnitio_reply_file" channel="reply-file-channel" >
<intoller id="filepoller" default="true">
<int:interval-trigger interval="200" />
Oct 10th, 2011, 05:05 AM
I am handling it by validating the xml file against XSD as i am getting XML as reply file.If validation fails means file is not written it's under progress.Once it is written completely it should be read now but my inblund adaptor is not picking it on completion.Is there any reason for it.
I know there is attribute prevent-duplicates which will be true by default that why after picking up the files once it will not pickup it in that session but i want if it has pickup the under progress file (as i checked it by my code that it is under progress)then it should pickup it again.is there any way sothat i can kill that thread and restart it to read that file again.
Last edited by resolve123; Oct 10th, 2011 at 06:08 AM.
Oct 17th, 2011, 10:35 PM
I had the same problem but not in a SI scenario. A large text file that is transmitted to us via internet daily with scp (openssh server in our side.) The line is slow so there is a big chance of catching a partial file. The file loader loader just compares the file write time with the current time, and awaits for a difference of 120 secs or more; else, the file is ignored for some time and the pooling restarts. The rationale is that a temporary line interruption should not be so large and that every file chunk received and saved is updating the file time automatically. It would be nice to have a similar functionality in the file components of SI.
Oct 18th, 2011, 05:25 AM
Is there any way in SI to know the file creation time.
Originally Posted by Diego Bravo
Oct 18th, 2011, 09:35 AM
Alternatively, if the process/application putting the file in the directory can rename the file to append some unique suffix, something like changing sample.dat to sample.dat.done (after its done putting), you can configure your SI code to only pickup files ending with ".done".
Last edited by GPS; Oct 18th, 2011 at 12:40 PM.
Reason: Making it more clear