camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bilgin Ibryam <>
Subject Re: New camel-hystrix component
Date Sun, 10 Apr 2016 11:03:06 GMT
While implementing the hystrix component, I had to choose whether to
use endpoint Ids or direct component for run/faillback endpoints.

I've chosen endpoints, as it allows defining any kind of endpoints
with all the options and then refer to it by its id. The downside is
that you have to add the endpoint to the registry.

I think adding also the direct compoent for referring to run/fallback
routes would simplify the use of this component. Something like this:

public void configure() {





The advantage is that there is no need of an endpointID and and more
importantly for adding the endpoint to the registry. The downside is
that you have to have a separate route that is using the direct


On 10 April 2016 at 11:19, Bilgin Ibryam <> wrote:
> Hi chaps,
> I'm also not very happy with the way endpointId are part of the
> hystrix URL but that was the only non-intrusive way I manged to
> implement it atm. Keep in mind that we want both Java and XML dsl
> solution. So if you have any ideas to make it easier to use, feel free
> to work on it. I won't have bandwidth to improve it further in near
> future.
> The previous time when I implemented the circuit breaker, the most
> appropriate location I found end up being the load balancer. It did
> nicely fit there, bit I think it is still not natural to say that CB
> is a LB strategy.
> This time I decided to use a component as I think hystrix is only one
> implementation of CB.
> In addition, hystrix does not implement only CB, but more and more
> things, which I find confusing. It does bulkheading (which is fine),
> but also request collapsing, and also caching.
> For something like request collapsing, the more natural way would be
> to have aggregator in Camel, and for the caching it would be better if
> we had caching DSL with various implementations (very importantly:
> distributed cache).
> I think for CB we need a new EIP, and not LB and a component. Hystrix
> can be an implementation of the EIP. And it might be better if the
> caching, request collapsing concepts are not mixed with the CB EIP.
> Cheers,
> On 6 April 2016 at 07:43, Claus Ibsen <> wrote:
>> There is some pros with being an endpoint configuration only, as it
>> can make it easy for tooling and some developers to use it (when they
>> are used to configure uris, and just use from -> to -> to etc). I
>> guess the bit unusual part is that you refer to endpoint by id's which
>> is not so commonly in use by Camel.
>> You could also have CB as a kind of error handler, aka onException,
>> but have it as onCircuitBreaker, where you can setup those breaker
>> configs and fallback routes / endpoint etc. And whether to use a
>> fallback or reject or whatnot.
>> Just a quick pseudo code / braindump
>> <onCurcuitBreaker threshold="2" halfOpenAfter="1000">
>>    <exception>IOException</exception>
>>    <to uri="bean:fallbackStuff"/>
>> </onCurcuitBreaker>
>> On Mon, Apr 4, 2016 at 6:07 PM, Preben.Asmussen <> 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="">
>>>         <hystrix>
>>>            <from=&quot;run&quot;/>
>>>            <fallback=&quot;http4://;/>
>>>             .............. 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:
>>> Sent from the Camel Development mailing list archive at
>> --
>> Claus Ibsen
>> -----------------
>> @davsclaus
>> Camel in Action 2:
> --
> Bilgin Ibryam
> Camel Committer at ASF & Integration Architect at Red Hat
> Blog: | Twitter: @bibryam
> Camel Design Patterns
> Instant Apache Camel Message Routing

Bilgin Ibryam
Camel Committer at ASF & Integration Architect at Red Hat
Blog: | Twitter: @bibryam

Camel Design Patterns
Instant Apache Camel Message Routing

View raw message