Hi Yeah the doc is wrong - Camel has changed the throttler to allow any kind of exceptions, so if that eval to null it throws an exception.
So we could likely add a new option you can turn on if that is okay - allowNullException or something like that - find a good name is sometime hard. Fell free to log a JIRA On Mon, May 19, 2014 at 7:22 PM, Elvio Caruana (ecaruana) <[email protected]> wrote: > Hit the send button too quickly... > > The problem I'm seeing is that if the header "throttleHeader" is null for > some messages, an exception is being thrown. I was expecting it to just use > the old value for the throttling calculation. > > > Elvio > > -----Original Message----- > From: Elvio Caruana (ecaruana) > Sent: 19 May 2014 18:09 > To: [email protected] > Subject: throttle EIP - unchanged value > > Hi all, > > I've either misunderstood the throttler documentation or there is a possible > discrepancy in the throttle documentation (I'm using Camel 2.13.1). > > Using the Java DSL: > .throttle(header("throttleHeader")) > > Documentation [1] states "If the header is absent, then the Throttler uses > the old value. So that allows you to only provide a header if the value is to > be changed" however > Throttler.java:108 throws an exception if the expression evaluates to null. > > > Thanks, > Elvio > > [1] http://camel.apache.org/throttler.html -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
