camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Cali <als...@gmail.com>
Subject Throtteling and dynamically changing MaxRequestsPerPeriod via Bean
Date Fri, 17 Apr 2015 13:02:59 GMT
I would like to change the MaxRequestsPerPeriod inside a Throttler.

I would like to use spring and having such a simple route, with some beans.
>>snip>>
    <bean id="hello" class="example.HelloImpl"/>
    <bean id="endMe" class="example.EndMe" />
    <bean id="configurationSource" class="example.ConfigurationSource" />

    <camelContext xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="direct:start"/>
            <throttle timePeriodMillis="1000">
                <method ref="configurationSource"
method="getMessagesPerSecond"/>
                <to uri="endMe"/>
            </throttle>
        </route>
    </camelContext>
<<snip&lt;&lt;

But I cant get it to work, I will always get an error:
java.lang.IllegalArgumentException: MaxRequestsPerPeriod expression must be
provided on Throttle[bean{configurationSource, method=getMessagesPerSecond}
request per 1000 millis -> [To[endMe]]]

Using 
<constant>3</constant> instead of the method expression works.

Did I misunderstood the concept of expressions?

Thx,
Alex



--
View this message in context: http://camel.465427.n5.nabble.com/Throtteling-and-dynamically-changing-MaxRequestsPerPeriod-via-Bean-tp5765952.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message