You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Elvio Caruana (ecaruana)" <ec...@cisco.com> on 2014/05/19 19:09:22 UTC
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
RE: throttle EIP - unchanged value
Posted by "Elvio Caruana (ecaruana)" <ec...@cisco.com>.
Thanks for confirming Claus,
Logged in CAMEL-7448.
-----Original Message-----
From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
Sent: 19 May 2014 18:26
To: users@camel.apache.org
Subject: Re: throttle EIP - unchanged value
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) <ec...@cisco.com> 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: users@camel.apache.org
> 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: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/
Re: throttle EIP - unchanged value
Posted by Claus Ibsen <cl...@gmail.com>.
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)
<ec...@cisco.com> 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: users@camel.apache.org
> 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: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/
RE: throttle EIP - unchanged value
Posted by "Elvio Caruana (ecaruana)" <ec...@cisco.com>.
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: users@camel.apache.org
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