[
https://issues.apache.org/jira/browse/CAMEL-10215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15403020#comment-15403020
]
Siddharth Sharma commented on CAMEL-10215:
------------------------------------------
Diff :
https://github.com/ssharma/camel/commit/ba14d20f536be101eca6c5fcd425355f06f9adca
> 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)