IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  File Poller picking up incomplete file

    Posted Wed January 11, 2006 04:18 AM

    Hi All,

    I have a situation wherein a service has not completed writing a file and the poller has picked up the incomplete file. Is there any work around for this.

    I am using the PSUtilities:file:writeToFile for writing to file, is there a bug with this service or is it a bug in the File Polling port of webMethods.

    Thanks
    Gaurav


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: File Poller picking up incomplete file

    Posted Wed January 11, 2006 12:28 PM

    If you are polling a directory for a file with a certain name or extension, have your service that is writing the file re-name it after writing is complete.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: File Poller picking up incomplete file

    Posted Thu January 12, 2006 04:01 AM

    This is definitely not a bug, but an incorrect understanding of file handling. As Chris points out, you need to make sure that the file polling process does not try to pick up a file before it has been completely written.

    A common approach is to write the file using a particular extension, for example myfile.tmp. When the writing is complete, then rename it to something like myfile.dat.

    Configure the file poller to pick up *.dat files and the picking up a file prematurely problem will disappear.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: File Poller picking up incomplete file

    Posted Wed January 03, 2007 03:23 AM

    Or…you can make use of the File Age field in the file polling port. Only pick up those files which are x seconds old. This will ensure incomplete files are not picked up.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: File Poller picking up incomplete file

    Posted Wed January 03, 2007 06:29 PM

    It makes it more likely, yes, but it does not ensure it. Factors that impact the time it takes to write the complete file, such as a large file or any network latency, can cause the problem to arise. Another scenario that can only be solved by using the rename technique is the case where the file is partially written but the sending source fails before completion. This will also cause a partial file to be processed.

    IMO, the file age approach to picking up files should be avoided as it doesn’t solve the problem–it just decreases the possibility.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 6.  RE: File Poller picking up incomplete file

    Posted Thu January 04, 2007 11:52 AM

    I would agree with Rob. We used the same policy.

    Poll for a file with *.txt extension.
    After picking, rename it to *.txt.working.
    Once the writing is done, rename it back to *.txt or *.txt.done

    My 0.02.

    HTH

    ~Malhar


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: File Poller picking up incomplete file

    Posted Fri January 05, 2007 10:39 PM

    We use two folders in this situation where the file with data written first into data directory, once write operation is completed then write a zero byte file into trigger directory with the same filename. Then we configure our adapter to poll trigger directory first, use the filename to read the data from data directory. Our folders will look lik the following

    /data
    /working
    /completion
    /incoming (or) /control (or) /trigger

    This worked for us in the past. (We are still on very old version of wM)


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods