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

fileExist=Move is broken when tempFile is also configured [Fuse 7.x]



    • Bug
    • Status: Done
    • Major
    • Resolution: Done
    • fuse-7.7-GA
    • fuse-7.9-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.


        Issue Links



              ldemasi Luigi De Masi
              ldemasi Luigi De Masi
              Branislav Smolicek Branislav Smolicek
              0 Vote for this issue
              3 Start watching this issue