Siddharth Sharma created CAMEL-10215:
----------------------------------------

             Summary: EventDrivenPollingConsumer is not thread safe when used 
with ConsumerCache 
                 Key: CAMEL-10215
                 URL: https://issues.apache.org/jira/browse/CAMEL-10215
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.18.0
            Reporter: Siddharth Sharma
             Fix For: 2.18.0


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.





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to