-
1. Re: fs-provider - can sequence of files being read be controlled?
tcunning Jan 23, 2014 10:07 AM (in response to stsc)Steffen,
The fs-provider provides a mechanism to filter out files (java.io.FileFilter), but not to ordering the files. Files are read in the order that java.io.File.listFiles(filter) presents, which according to the JavaDoc guarantees no specific ordering method.
I think you could probably work around this. If you extend AbstractFileGateway you can define how getFileList() works - basically if all you want to do is add ordering, you could copy the entirety of FileGatewayListener.java and just change the filterFiles method to give yourself some file ordering. You would also have to change FsListenerMapper.java to recognize your new file gateway (or provide your own mapping).
You could also work around the whole problem by providing a staging directory with cron scripts to move small numbers of files into the file gateway listener directory, depending on how many files are in there at the current time.
--Tom
-
2. Re: fs-provider - can sequence of files being read be controlled?
vamshi.chilukamarri Apr 22, 2014 11:42 AM (in response to stsc)Hi sschmidt
Have you had a chance to implement your own FileGatwayListener as Tom suggested. Could you please share your thoughts on how your approach was to override and configure it to use this new custom class ?
I am in similar situation as I have to filter files based on the filename, I am refraining from using external cron job at this point if it can be solved inside ESB.
Thanks
Vamshi
-
3. Re: fs-provider - can sequence of files being read be controlled?
tcunning Apr 23, 2014 11:06 AM (in response to vamshi.chilukamarri)Vamshi,
There isn't a way to solve this inside of the ESB, other than to change the code to filterFiles() like I cited above. You could do this through AOP if you wanted, if you didn't want to alter any ESB code.
--Tom
-
4. Re: fs-provider - can sequence of files being read be controlled?
vamshi.chilukamarri Apr 23, 2014 11:31 AM (in response to tcunning)Thanks Tom for the reply. Can you please guide me what will be the approach for AOP ? never worked on that.
Appreciate your help
Thanks