You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by leroykendall <le...@yahoo.com> on 2013/01/14 08:11:43 UTC

Properties are not resolved inside of choice

Hi,

I'm using Camel 2.10.0.
In Spring context configuration I have an issue with properties resolution
{{...}} when they are inside of <choice> tag.
Resolution of the property "throttle.requests.per.second" does NOT work for:
        <route>
            <from uri="direct:endpointBean"/>
            <choice>
                <when>
                    <simple>${in.body} > 0</simple>
                    <throttle timePeriodMillis="1000">
                       
<constant>{{throttle.requests.per.second}}</constant>
                        <bean ref="endpointBean"/>
                    </throttle>
                </when>
            </choice>
        </route>

But it DOES work when throttle tag is before the choice:
        <route>
            <from uri="direct:endpointBean"/>
            <throttle timePeriodMillis="1000">
                <constant>{{throttle.requests.per.second}}</constant>
                <choice>
                    <when>
                        <simple>${in.body} > 0</simple>
                        <bean ref="endpointBean"/>
                    </when>
                </choice>
            </throttle>
        </route>

Could you please advise whether it is known defect?

Thanks.
--Victor



--
View this message in context: http://camel.465427.n5.nabble.com/Properties-are-not-resolved-inside-of-choice-tp5725523.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Properties are not resolved inside of choice

Posted by leroykendall <le...@yahoo.com>.
Hi Claus,

Thank you for the help!
It works excellent even in 2.10.0 for both cases:
<simple>${properties:throttle.requests.per.second}</simple> 

Regards,
--Victor



--
View this message in context: http://camel.465427.n5.nabble.com/Properties-are-not-resolved-inside-of-choice-tp5725523p5725593.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Properties are not resolved inside of choice

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jan 15, 2013 at 7:58 AM, Claus Ibsen <cl...@gmail.com> wrote:
> On Mon, Jan 14, 2013 at 8:11 AM, leroykendall <le...@yahoo.com> wrote:
>> Hi,
>>
>> I'm using Camel 2.10.0.
>
> I think we have fixed this since that release. Try with latest 2.10.x
> release. Or the SNAPSHOT.
>

And if you stay on 2.10.0, you can use <simple> instead and refer to
the property placeholder using
<simple>${properties:throttle.requests.per.second}</simple>

See details at
http://camel.apache.org/simple



>
>> In Spring context configuration I have an issue with properties resolution
>> {{...}} when they are inside of <choice> tag.
>> Resolution of the property "throttle.requests.per.second" does NOT work for:
>>         <route>
>>             <from uri="direct:endpointBean"/>
>>             <choice>
>>                 <when>
>>                     <simple>${in.body} > 0</simple>
>>                     <throttle timePeriodMillis="1000">
>>
>> <constant>{{throttle.requests.per.second}}</constant>
>>                         <bean ref="endpointBean"/>
>>                     </throttle>
>>                 </when>
>>             </choice>
>>         </route>
>>
>> But it DOES work when throttle tag is before the choice:
>>         <route>
>>             <from uri="direct:endpointBean"/>
>>             <throttle timePeriodMillis="1000">
>>                 <constant>{{throttle.requests.per.second}}</constant>
>>                 <choice>
>>                     <when>
>>                         <simple>${in.body} > 0</simple>
>>                         <bean ref="endpointBean"/>
>>                     </when>
>>                 </choice>
>>             </throttle>
>>         </route>
>>
>> Could you please advise whether it is known defect?
>>
>> Thanks.
>> --Victor
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Properties-are-not-resolved-inside-of-choice-tp5725523.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Properties are not resolved inside of choice

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Jan 14, 2013 at 8:11 AM, leroykendall <le...@yahoo.com> wrote:
> Hi,
>
> I'm using Camel 2.10.0.

I think we have fixed this since that release. Try with latest 2.10.x
release. Or the SNAPSHOT.


> In Spring context configuration I have an issue with properties resolution
> {{...}} when they are inside of <choice> tag.
> Resolution of the property "throttle.requests.per.second" does NOT work for:
>         <route>
>             <from uri="direct:endpointBean"/>
>             <choice>
>                 <when>
>                     <simple>${in.body} > 0</simple>
>                     <throttle timePeriodMillis="1000">
>
> <constant>{{throttle.requests.per.second}}</constant>
>                         <bean ref="endpointBean"/>
>                     </throttle>
>                 </when>
>             </choice>
>         </route>
>
> But it DOES work when throttle tag is before the choice:
>         <route>
>             <from uri="direct:endpointBean"/>
>             <throttle timePeriodMillis="1000">
>                 <constant>{{throttle.requests.per.second}}</constant>
>                 <choice>
>                     <when>
>                         <simple>${in.body} > 0</simple>
>                         <bean ref="endpointBean"/>
>                     </when>
>                 </choice>
>             </throttle>
>         </route>
>
> Could you please advise whether it is known defect?
>
> Thanks.
> --Victor
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Properties-are-not-resolved-inside-of-choice-tp5725523.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen