You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by nanikpranjith9 <na...@gmail.com> on 2017/05/04 21:00:18 UTC

hystrix fallback configuration for camel dynamic router returning multiple endpoints

Hello, How do we configure hystrix fallback for dynamic router invoking
multiple endpoints, the catch with dynamic router is how to identify
failures out of multiple endpoint invocations.

*camel route:*
from(rmq:localhost/exchange?queue=somequeue).bean(SomeDynamicRouter.class)

class SomeDynamicRouter {

 @DynamicRouter
 public String next(String body, @Header(value = Exchange.SLIP_ENDPOINT)
String previous) {
  if (null == previous) {
   return <delimitedmultipleendpoints > ;
  } else {
   return null;
  }
 }
}




--
View this message in context: http://camel.465427.n5.nabble.com/hystrix-fallback-configuration-for-camel-dynamic-router-returning-multiple-endpoints-tp5798655.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: hystrix fallback configuration for camel dynamic router returning multiple endpoints

Posted by nanikpranjith9 <na...@gmail.com>.
Thanks for replying Claus. With the second approach you mentioned having
hystrix eip in camel route the dynamic router would trigger all the
endpoints even when one endpoint failed which is not desired in the use case
i'm trying to solve. And for the first approach it would be helpful if you
could point me to any working example?



--
View this message in context: http://camel.465427.n5.nabble.com/hystrix-fallback-configuration-for-camel-dynamic-router-returning-multiple-endpoints-tp5798655p5799111.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: hystrix fallback configuration for camel dynamic router returning multiple endpoints

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

We could also consider looking at supporting the HystrixCommand
annotation from hystrix in some way or form (or add our own) so you
can specify that together with @DynamicRouter or @RecipientList so we
can wrap those via hystrix.

But for now you would need to either have hystrix eip in that camel route, eg

from
   hystrix
      bean


On Thu, May 4, 2017 at 5:00 PM, nanikpranjith9 <na...@gmail.com> wrote:
> Hello, How do we configure hystrix fallback for dynamic router invoking
> multiple endpoints, the catch with dynamic router is how to identify
> failures out of multiple endpoint invocations.
>
> *camel route:*
> from(rmq:localhost/exchange?queue=somequeue).bean(SomeDynamicRouter.class)
>
> class SomeDynamicRouter {
>
>  @DynamicRouter
>  public String next(String body, @Header(value = Exchange.SLIP_ENDPOINT)
> String previous) {
>   if (null == previous) {
>    return <delimitedmultipleendpoints > ;
>   } else {
>    return null;
>   }
>  }
> }
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/hystrix-fallback-configuration-for-camel-dynamic-router-returning-multiple-endpoints-tp5798655.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