Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-8954

Lock information is not handovered together with Exchange on-completion synchronizations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.14.3
    • 2.15.3, 2.16.0
    • camel-core
    • None
    • Unknown

    Description

      This applies to the file components when using common read-lock strategies:

      • markerFile - org.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy
      • fileLock - org.apache.camel.component.file.strategy.FileLockExclusiveReadLockStrategy

      This strategies stores lock information in the Exchange properties:

      • Exchange.FILE_LOCK_FILE_ACQUIRED == "CamelFileLockFileAcquired"
      • Exchange.FILE_LOCK_FILE_NAME == "CamelFileLockFileName"
      • Exchange.FILE_LOCK_EXCLUSIVE_LOCK == "CamelFileLockExclusiveLock"
      • Exchange.FILE_LOCK_RANDOM_ACCESS_FILE == "CamelFileLockRandomAccessFile"

      Lock information is stored as scalar values and can hold information about only one single lock.

      When there are two Exchanges participates in the route, share UoW, and synchronizations are handovered from one Exchange to another, information about both locks can't be stored in the Exchange properties and lost. Consequently when on-completion synchronizations are performed, read-lock strategies can't access information about all the locks and they are not released.

      For example, after completing this route lock for file1.dat is not released:

      from("file:data/input-a?fileName=file1.dat&readLock=markerFile")
          .pollEnrich("file:data/input-b?fileName=file2.dat&readLock=markerFile")
          .to("mock:result");
      

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            andy.fedotov Andy Fedotov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: