Hi

Btw in Camel at runtime it all boils down to
org.apache.camel.Processor. So you can implement your own Processor
that acts as a dynamic throttler that can do grouping and different
QoS depending on some header values etc.

You just use .process(new MyThrottlerProcessor() instead of .throttle.



On Thu, Jun 4, 2009 at 3:16 PM, Claus Ibsen <[email protected]> wrote:
> Hi
>
> On Thu, Jun 4, 2009 at 2:11 PM, angeloNZ <[email protected]> 
> wrote:
>>
>> Hi,
>>
>> I'm using Camel alongside ServiceMix.  I want to get advise on how to
>> properly use the Throttler for a particular scenario.  I have a use case
>> where clients sending requests to ServiceMix will have different Quality of
>> Service values based on their gven credentials.  Once the request is
>> received, an LDAP server will be queried for the client's appropriate QoS
>> value.  This value is then intended to be used as the throttler value in the
>> DSL definition:
>>
>> from("jbi:service:...").throttle(<retrieved QoS value>).to("...");
>>
>> Question 1:  does this approach ensure that the different clients would be
>> throttled differently for the same endpoint?
> No there is only 1 throttler so it will throttle the same for all
> messages going through it.
>
> You can use a Content Based Router to route to different routes where each 
> route
> suits a particular QoS.
>
> The throttler is however a bit to static as it is configured once in
> the route and then uses
> the same values at runtime.
>
> I will add a ticket to improve it so you can
> - define the throttle values using an expression
>
> What the throttler is missing is some sort of group knowledge. If we
> added some correlation expression
> then you could use that to distringiush your clients.
>
> And with this correlation id Camel can use it as a key to obtain the
> QoS for the throtteling.
> This allows it to be dynamic at runtime and use different QoS for
> different messages.
>
> And all in the same route.
>
>
>>
>> Question 2:  In this scenario the LDAP server is queried for the throttle
>> value every request and then set to the DSL each time.  I feel like this
>> isn't quite a good approach to throttling.  Wouldn't doing this somehow
>> reset the throttler each time per request?  What would be a good approach to
>> avoid resetting the throttle value each time and make successive requests
>> from the same client count towards the first throttle value set?
> Yeah see above.
>
>
>
>>
>>
>> --
>> View this message in context: 
>> http://www.nabble.com/Suggestions-on-setting-different-Throttler-values-per-Client-tp23868691p23868691.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to