camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Discussion - Route Policy feature in Camel 2.1
Date Wed, 28 Oct 2009 07:15:13 GMT

A bit of background is 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 .../>

<bean id="myRoutePolicy" class=...>
   <property name="maxInflightExchanges" value="500"/>

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


Claus Ibsen
Apache Camel Committer

Author of Camel in Action:
Open Source Integration:

View raw message