Hi

I recently added an example as well based on throttling a jms route.

camel-example-route-throttling

There is a README.txt with instructions to run it.



On Wed, Oct 28, 2009 at 8:15 AM, Claus Ibsen <[email protected]> wrote:
> Hi
>
> A bit of background is CAMEL-1048
> https://issues.apache.org/activemq/browse/CAMEL-1048
>
> I am looking into this how to implement this nicely in Camel.
>
> CAMEL-1048 is maybe a bit too much at current requirements from Camel users.
> What they are looking for is to be able to dynamic throttle consumers.
>
> Apache CXF and ServiceMix has such a feature specially build in their
> JMS components.
> What it does is that it can stop the JMS listener when there are too
> many messages in flight.
>
> But on the other hand we have also had Camel users wanting to dynamic
> start/stop consumers depending on some flag of some sort.
> So there is also grounds to make this a general solution that can
> cater both use cases.
>
> I do wonder how to move forward.
> In CAMEL-1048 there is an example using requires to associate a route
> that this predicate must be true for the route to be running.
> I do not like the naming requires or require. And having it in the
> fluent builder / DSL makes it fixed.
>
> Wonder if we should name such a configuration a RoutePolicy so you can
> configure it as
>
> <route routePolicy="myRoutePolicy">
>   <from .../>
>  ...
> </route>
>
> <bean id="myRoutePolicy" class=...>
>   <property name="maxInflightExchanges" value="500"/>
> </bean>
>
> This is quite flexible as we can just offer a SPI interface for the
> RoutePolicy and have people implement it as how they like it.
> For example as above something that is controlled by the number of
> current in flight exchanges.
>
> Others can control it by CPU utliization, a switch, timer based etc.
>
>
> In the Java DSL its
>
> from("xxx").routePolicy(myRoutePolicy).to(yyyy);
>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to