You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by r_karthik1 <re...@gmail.com> on 2016/11/04 14:20:41 UTC

Camel - Hystrix

I am new to Camel and Hystrix, I am trying to imple hystrix in my project.
Before making sure I can move with hystrix for circuit break scenarios. I
tried the following with give hystrix eample.

When I enable the circuitBreakerForceOpen, its not even entering into the
Bean that I defined. myunderstanding with circuitBreakerForceOpen is enabled
with irrespective of error scenario it has to enter into short circuit path
(i.e. into testBean) but its not. Do I am missing any configuration or I mis
understood the property. Any help would be appericiated

 @Override
    public void configure() {
        // you can configure the route rule with Java DSL here
        from("timer:trigger?period=1s").streamCaching()
            .bean("counterBean")
            .log(" Client request: ${body}")
            .hystrix()
                .hystrixConfiguration().
                circuitBreakerForceOpen(true).end()
                .to("http://localhost:9090/service1")
          //  .onFallback()
            // we use a fallback without network that provides a repsonse
message immediately
            //    .transform().simple("Fallback ${body}")
               //.transform()//simple("${bean:testBean?method=testCall}")
            .onFallbackViaNetwork()
                // we use fallback via network where we call a 2nd service*/
                .to("http://localhost:7070/service2")
                .end()
                .log("Client response: ${body}");
    }




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Hystrix-tp5789751.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel - Hystrix

Posted by r_karthik1 <re...@gmail.com>.
Thanks...Sure will try it out.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Hystrix-tp5789751p5789848.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel - Hystrix

Posted by Claus Ibsen <cl...@gmail.com>.
All code are in github
https://github.com/apache/camel/

And you can find the code for the 2.18.x branch there, which you can build
http://camel.apache.org/building

It takes a while to build (even if using fast install)

   mvn install -Pfastinstall

You can also try the master branch instead if you want to test latest
code that would become Camel 2.19.

On Fri, Nov 4, 2016 at 8:20 PM, r_karthik1 <re...@gmail.com> wrote:
> Thanks for your quickresponse.
>
> From where I can get 2.18.1 source code to build? its already there in
> Github?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Hystrix-tp5789751p5789785.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Camel - Hystrix

Posted by r_karthik1 <re...@gmail.com>.
Thanks for your quickresponse.

From where I can get 2.18.1 source code to build? its already there in
Github?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Hystrix-tp5789751p5789785.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel - Hystrix

Posted by Claus Ibsen <cl...@gmail.com>.
There was a bug fixed recently in camel-hystrix so you can try 2.18.1
when its released or with the latest source code you can build
yourself


On Fri, Nov 4, 2016 at 3:20 PM, r_karthik1 <re...@gmail.com> wrote:
> I am new to Camel and Hystrix, I am trying to imple hystrix in my project.
> Before making sure I can move with hystrix for circuit break scenarios. I
> tried the following with give hystrix eample.
>
> When I enable the circuitBreakerForceOpen, its not even entering into the
> Bean that I defined. myunderstanding with circuitBreakerForceOpen is enabled
> with irrespective of error scenario it has to enter into short circuit path
> (i.e. into testBean) but its not. Do I am missing any configuration or I mis
> understood the property. Any help would be appericiated
>
>  @Override
>     public void configure() {
>         // you can configure the route rule with Java DSL here
>         from("timer:trigger?period=1s").streamCaching()
>             .bean("counterBean")
>             .log(" Client request: ${body}")
>             .hystrix()
>                 .hystrixConfiguration().
>                 circuitBreakerForceOpen(true).end()
>                 .to("http://localhost:9090/service1")
>           //  .onFallback()
>             // we use a fallback without network that provides a repsonse
> message immediately
>             //    .transform().simple("Fallback ${body}")
>                //.transform()//simple("${bean:testBean?method=testCall}")
>             .onFallbackViaNetwork()
>                 // we use fallback via network where we call a 2nd service*/
>                 .to("http://localhost:7070/service2")
>                 .end()
>                 .log("Client response: ${body}");
>     }
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Hystrix-tp5789751.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2