camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yves De Moor (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-5539) Circuit Breaker EIP
Date Mon, 27 Oct 2014 14:47:35 GMT

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

Yves De Moor commented on CAMEL-5539:
-------------------------------------

Simple, quick and most flexible solution could be :

Put the number of failure in an exchange property.
Put circuit state in an exchange property (2 status : Open / closed, as halfOpen do the same
as closed in term of business)
use a Content Based Router to perform something like

from("direct:a")
            .loadBalance()//
            .circuitBreaker(3, 3000L, MyCustomException.class)
            .choice()
                .when(property(Exchange.CircuitBreaker_state).isEqualTo("closed"))
                    .to("direct:normalMode")
                .when(property(Exchange.CircuitBreaker_state).isEqualTo("opened"))
                    .to("direct:degradedMode")
             .end()

from("direct:degradedMode")
            .choice()
                .when(property(Exchange.CircuitBreaker_errorCount).isEqualTo("1")) //First
error encountered, send an alert to monitoring
                    .to("direct:monitorging_alert_degradedMode")
             .end()



I also see the current solution is not enough robust. 
when halfOpen is reached, (System.currentTimeMillis() - lastFailure < halfOpenAfter) there
is no restriction on the number of calls (threads) that will perform a retry.

When retry timeout is reached, we should let only 1 thread go in "halfOpen" mode, all other
should be kept in "open" state until an halfOpen succeed.
(will create new issue for this)

Yves.



> Circuit Breaker EIP
> -------------------
>
>                 Key: CAMEL-5539
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5539
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core, eip
>            Reporter: Claus Ibsen
>            Assignee: Raúl Kripalani
>             Fix For: Future
>
>         Attachments: CAMEL-5539-output-82ef800.txt, CAMEL-5539-output.txt
>
>
> Look at add the circuit breaker EIP to the Camel DSL.
> http://davybrion.com/blog/2008/05/the-circuit-breaker/
> Would need some thoughts for that though. Either as an explicit in the DSL. Or as a interceptor
for sending to an endpoint. As explicit its a kind to the load balancer (in fact it may be
extended upon that). Either the LB selects the intended target, or it select the breaker,
which rejects executing the message.



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

Mime
View raw message