How to get exception which caused the hystrix fallback?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get exception which caused the hystrix fallback?

Abhishek.Jha09
Hi,

I'm testing hystrix along with camel routes (in JAVA DSL). So these routes are essentially of the form:

[from(direct:a)
     .hystrix()
         .to("http4:localhost:8080/mock/success")
     .onFallBack()
          .process(ex -> ex.getOut().setBody("Hystrix fallback message"))
     .end()]

In this route, when fallback is triggered, I want to log the root cause which triggered the fallback. Is there a way to do this?
Reply | Threaded
Open this post in threaded view
|

Re: How to get exception which caused the hystrix fallback?

Claus Ibsen-2
Yeah its stored as a property on the exchange
http://camel.apache.org/why-is-the-exception-null-when-i-use-onexception.html

On Thu, Mar 16, 2017 at 12:06 PM, Abhishek.Jha09 <[hidden email]> wrote:

> Hi,
>
> I'm testing hystrix along with camel routes (in JAVA DSL). So these routes
> are essentially of the form:
>
> [from(direct:a)
>      .hystrix()
>          .to("http4:localhost:8080/mock/success")
>      .onFallBack()
>           .process(ex -> ex.getOut().setBody("Hystrix fallback message"))
>      .end()]
>
> In this route, when fallback is triggered, I want to log the root cause
> which triggered the fallback. Is there a way to do this?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-get-exception-which-caused-the-hystrix-fallback-tp5795574.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