You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by gramanero <gr...@gmail.com> on 2012/06/04 19:23:08 UTC

ThrottlingInflightRoutePolicy

I need to verify my understanding of the ThrottlingInflightRoutePolicy. I
have the following policy and route defined:

<bean id="myPolicy"
class="org.apache.camel.impl.ThrottlingInflightRoutePolicy">
	<property name="scope" value="Route"/>
	<property name="maxInflightExchanges" value="1000"/>
	<property name="resumePercentOfMax" value="70"/>
	<property name="loggingLevel" value="WARN"/>
  </bean>

    <route id="myRoute" startupOrder="1" routePolicyRef="myPolicy" >
        <from uri="activemq:queue:myQueue"/>
        <to uri="cxfrs:http://localhost:9999/MyService" pattern="InOnly"/>
    </route>

My understanding is that, after each completed exchange the policy will
check the current number of exchanges that are "in-flight" and if that
number exceeds the maximumInflightExchanges, then it will suspend the route
until the percentage of "in-flight" exchanges reaches the resumePercentOfMax
number of exchanges. At that point, the route will be resumed. This will
have the impact of preventing the overloading of the cxfrs endpoint.

Is this correct?

If so, what does that mean for other routes that have a <to
uri="activemq:queue:myQueue" />, essentially dumping entries into myQueue?
Are the entries still pushed onto the queue, but just not picked up until
the route is resumed?

Lastly, is the "value" of the scope element for the policy specified as
"Route" or the name of the actual route? I'm assuming "Route" because the
actual route itself will specify the policy that it refers to.

Thanks for any assistance in answering these questions!


--
View this message in context: http://camel.465427.n5.nabble.com/ThrottlingInflightRoutePolicy-tp5713970.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ThrottlingInflightRoutePolicy

Posted by gramanero <gr...@gmail.com>.
Perfect. Thank you Claus! Your quick response is very much appreciated.

--
View this message in context: http://camel.465427.n5.nabble.com/ThrottlingInflightRoutePolicy-tp5713970p5713973.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ThrottlingInflightRoutePolicy

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Jun 4, 2012 at 7:23 PM, gramanero <gr...@gmail.com> wrote:
> I need to verify my understanding of the ThrottlingInflightRoutePolicy. I
> have the following policy and route defined:
>
> <bean id="myPolicy"
> class="org.apache.camel.impl.ThrottlingInflightRoutePolicy">
>        <property name="scope" value="Route"/>
>        <property name="maxInflightExchanges" value="1000"/>
>        <property name="resumePercentOfMax" value="70"/>
>        <property name="loggingLevel" value="WARN"/>
>  </bean>
>
>    <route id="myRoute" startupOrder="1" routePolicyRef="myPolicy" >
>        <from uri="activemq:queue:myQueue"/>
>        <to uri="cxfrs:http://localhost:9999/MyService" pattern="InOnly"/>
>    </route>
>
> My understanding is that, after each completed exchange the policy will
> check the current number of exchanges that are "in-flight" and if that
> number exceeds the maximumInflightExchanges, then it will suspend the route
> until the percentage of "in-flight" exchanges reaches the resumePercentOfMax
> number of exchanges. At that point, the route will be resumed. This will
> have the impact of preventing the overloading of the cxfrs endpoint.
>
> Is this correct?
>

Yes


> If so, what does that mean for other routes that have a <to
> uri="activemq:queue:myQueue" />, essentially dumping entries into myQueue?
> Are the entries still pushed onto the queue, but just not picked up until
> the route is resumed?
>

This route is consuming from the queue, so any producers can still
send messages to the queue, which just stack up


> Lastly, is the "value" of the scope element for the policy specified as
> "Route" or the name of the actual route? I'm assuming "Route" because the
> actual route itself will specify the policy that it refers to.
>

Yes the scope is either route, which mean the given route, or context,
which mean the camel context.
The scope decides if the current in flight number is from the given
route, or from all routes together (eg context).


> Thanks for any assistance in answering these questions!
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/ThrottlingInflightRoutePolicy-tp5713970.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen