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

EventDrivenPollingConsumer is not thread safe when used with ConsumerCache

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.18.0
    • 2.16.4, 2.17.3, 2.18.0
    • camel-core
    • None
    • Patch Available
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: