Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-15098

fileExist=Move is broken when tempFile is also configured

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • fuse-6.3-R18-GA
    • fuse-6.3-R16-GA, fuse-7.7-GA
    • Camel
    • None

      ================================
      Our use case
      ================================
      We want to write files to a destination with both

      • never overwrite existing files, but rename or move them before the new file is written
      • avoid consumers reading in progress files, by writing to a temporary filename until the file is complete, and rename it afterwards.
        We think this is a very common use case. And Camel File and Sftp component have options to achieve that goal.
      • "fileExist=Move" should prevent accidential overwriting of target files
      • "tempPrefix/tempFileName" should prevent consumers from reading incomplete files
        But, unfortunately, when we combine these options, fileExist=Move doesn't work any more. In fact, the destination file will be overwritten.

      The documentation states:

      • "fileExist=Move": The Move option will move any existing files, before writing the target file. The Move option requires the corresponding moveExisting option to be configured as well.
        We use "fileExist=Move" and "moveExisting=arch${date:now:yyyyMMddHHmmssSSS}".
      • tempPrefix: This option is used to write the file using a temporary name and then, after the write is complete, rename it to the real name.
      • tempFileName: The same as tempPrefix option but offering a more fine grained control on the naming of the temporary filename.
        We use "tempFileName=__${file:onlyname}.tmp".
        The combiniation of these option is not restricted in any way. But it doesn't work.
        ================================

              ldemasi Luigi De Masi
              rhn-support-vgohel Viral Gohel (Inactive)
              Branislav Smolicek Branislav Smolicek
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: