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

file2: pollEnrich with sendEmptyMessageWhenIdle does not send correct Exchanges

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.21.5, 2.22.3, 2.23.2, 2.24.0
    • None
    • came-core
    • None
    • Unknown

    Description

      I use the file component in pollEnrich with sendEmptyMessageWhenIdle=true and readLock=changed

      In 2.20.4 and before the attached test case worked, from 2.21.0 on it fails.

      My test writes several characters delayed into a file so that the component runs into a timeout after 10000ms on the first call. This is correct.

      On the second call the writing of the file is finished within the 10000ms, my expectation is the correct processing of the file in my route, but it fails because the Exchange has an empty body.

      I debugged the thing an saw that in the variable GenericFilePollingConsumer.queue there are two exchanges instead of one. The first one sems to be the "empty" message from the first call without a GenericFile in the In-Body, and the second Exchange in the queue is the correct one with the GenericFile from the second call.

      Because it's a FiFo, only the first, empty one is returned (in EventDrivenPollingConsumer.receive()) so that the route states that there is nothing to do.

      I suspect an error in the processing of the empty message, so that it is not cleared or taken properly from the queue so that it remains there and conflicts with later calls.

      Attachments

        1. camel-fileconsumer-bug.zip
          24 kB
          Volker Althaus
        2. camel-fileconsumer-bug.log
          175 kB
          Volker Althaus

        Activity

          People

            davsclaus Claus Ibsen
            volker.a Volker Althaus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: