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

EventDrivenPollingConsumer is not thread safe when used with ConsumerCache

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.18.0
    • Fix Version/s: 2.16.4, 2.17.3, 2.18.0
    • Component/s: camel-core
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Unknown

      Description

      For static endpoints, if DefaultConsumerTemplate#receive() is used, ConsumerCache will return the cached instance of PollingConsumer for every thread part of parallel processing of split/aggregate.

      Now, if EventDrivenPollingConsumer is used, returning same cache instance causes race condition in receive and receive(long) as the methods are not thread safe. The ordering of beforePoll, poll and afterPoll needs to be synchronized, otherwise the consumer might end up being suspended in afterPoll and the client whose beforePoll couldn't wake up the suspended thread will get no data.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                davsclaus Claus Ibsen
                Reporter:
                sidshar Siddharth Sharma
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: