[ 
https://issues.apache.org/jira/browse/CAMEL-7973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14189740#comment-14189740
 ] 

Claus Ibsen commented on CAMEL-7973:
------------------------------------

Willem the patch is partly correct, eg the stuff about the exception etc. But 
calling the processor should be the async with the callback, eg the last part 
of the patch is not correct. That may need a bit more logic to implement 
correctly, as you may need to add logic in the callback to do after work in the 
circuit breaker. I have not yet taken a closer look, but just beware more work 
is likely needed to fix this properly.

> CircuitBreakerLoadBalancer fails on async processors
> ----------------------------------------------------
>
>                 Key: CAMEL-7973
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7973
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.14.0
>            Reporter: Matteo Pavesi
>            Assignee: Willem Jiang
>            Priority: Minor
>         Attachments: 
> 0001-CAMEL-7973-added-failing-test-for-circuit-breaker-wi.patch, 
> 0002-CAMEL-7973-fix-circuit-breaker-with-async-processors.patch
>
>
> The CircuitBreakerLoadBalancer works fine on direct synchronous processor, 
> but it seems to not behave as expected in case of async processor.
> To reproduce the error, it's enough to add a .threads(1) before the mock 
> processor in the CircuitBreakerLoadBalancerTest routeBuilder configuration.
> This misbehaviour seems to be related to the use of the 
> AsyncProcessorConverterHelper to force any processor to behave like 
> asynchronous. 
> I'm going to propose a patch with the failing test and a proposal of solution.
> EDIT:
> the patch contains the fix also to other unexpected behaviour of the 
> CircuitBreaker.
> The second problem addressed is that, after the opening of the circuit, the 
> RejectedExecutionException raised by the circuit breaker is set in the 
> Exchange, but it doesn't return. This cause the processor will receive the 
> Exchange even if the circuit is open. In this case also, if the 
> CircuitBreaker is instructed to react only to specific Exception, it will 
> close the circuit after the following request, because the raised exception 
> would be a RejectedExecutionException instead of the one specified in the 
> configuration.



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

Reply via email to