On Mon, Apr 4, 2016 at 6:22 PM, Raul Kripalani <[email protected]> wrote:
> That was my exact same thought when I took a stab at the camel-hystrix
> component myself:
> https://github.com/apache/camel/commits/feature/camel-hystrix.
>
> For me, Hystrix is not an endpoint but a mechanism to deal with failure, no
> matter if thrown by an endpoint, a processor, or any other element of a
> route.
>
> For Java DSL, I proposed something like:
>
> HystrixComponent hystrix = context.getComponent("hystrix",
> HystrixComponent.class);
>
> from("activemq:queue:abc)
>          .to(hystrix.wrapper()
>                  .forStaticEndpoint("http4://localhost:8080/...", setter)
>                  .withFallbackProcessor((exchange) ->
> exchange.getIn().setBody("failure!"))
>                  .withCacheKey(ExpressionBuilder.bodyExpression())
>                  .suppressFallbackForExceptions(DummyException.class)
>                  .build());
>
>
> For XML, we could create a DSL too but it would live in the camel-core
> module with a runtime dependency on camel-hystrix and transitives (e.g.
> like we do today with the data formats <xstream/>, expression languages
> <ognl/>, etc.).
>
> I got stuck with my camel-hystrix component at the stage of integrating
> Archaius with the Spring and Blueprint property placeholders.
>

There is already the circuit breaker as a load balancer. It makes more
sense for me to improve on that to offer a way to configure a fallback
processor / endpoint / child route etc.
Or if the load balancer starts to mis-fit then move it out as a
standalone eip. I suspect this is more the case, and do not mind doing
this.

For the actual implementation if people want to use hystrix we can
make it load it if you add camel-hystrix as a dependency. As you say
we can do with data formats. Or recently with camel-java-swagger.

hystrix is not the only CB implementation. vert.x has a implementation
out of the box as well.
And you can say the current implementation in camel-core is also an
implementation.



> Cheers,
>
> *Raúl Kripalani*
> PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and
> Messaging Engineer
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> Blog: raul.io
> <http://raul.io/?utm_source=email&utm_medium=email&utm_campaign=apache> |
> twitter: @raulvk <https://twitter.com/raulvk>
>
> On Mon, Apr 4, 2016 at 5:07 PM, Preben.Asmussen <[email protected]> wrote:
>
>> Hi bibryam
>>
>> At first glance it looks a bit intrusive when the usual endpoints are
>> 'wrapped' in the hystrix endpoint.
>>
>> Could it be something like -> psudo code
>>
>> <camelContext id="hystrix-producer"
>> xmlns="http://camel.apache.org/schema/blueprint";>
>>         <hystrix>
>>            <from=&quot;run&quot;/>
>>            <fallback=&quot;http4://www.google.com&quot;/>
>>             .............. other options
>>         </hystrix>
>>
>>         <route>
>>           <from
>> uri="timer://local?fixedRate=true&amp;period=50&amp;repeatCount=5"/>
>>
>>
>>           <to id="run" uri="http4://localhost"/>
>>
>>           <to uri="log:hystrix?level=INFO&amp;showHeaders=true"/>
>>       </route>
>>   </camelContext>
>>
>> /Preben
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/New-camel-hystrix-component-tp5770955p5780454.html
>> Sent from the Camel Development mailing list archive at Nabble.com.
>>



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

Reply via email to