File polling is basically a scheduled activity. The schedule is established on the file polling port config instead of the scheduler page–but underneath the scheduler is used.
The way to avoid picking up partial files is this:
- The process writing the files uses a temporary filename of some sort. Like “myFile20100530.csv.tmp”.
- When the source process has finished writing it renames the file to “myFile20100503.csv”. Renames are an atomic operation.
- The file polling looks only for *.csv files and ignores all others.
This guarantees that a file will only be picked up if the source process is finished writing and has successfully renamed it, regardless of the nature of the protocol being used (e.g. writing via FTP, shared disk, etc.).
With this approach, the file poller will never pick up:
- Files that are still be written to by the source process.
- Files that are incomplete due to a failure of the source process.
The file polling port has a facility to wait for a period of time (file age) before processing a file. This can be effective but in some cases simply reduces, rather than eliminates, the potential for picking up partial files.
#webMethods#Flow-and-Java-services#Integration-Server-and-ESB