You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by bxkrish <ba...@gmail.com> on 2013/08/21 01:11:52 UTC

reading integer values from properties file

Hi 

I am using Camel API "propertyPlaceholder" to access my properties. All the
String values are resolved without any issues. Can you please provide any
insight on reading integer values? 

Camel Version = 2.4

*Configuration:*

<camelContext..>
<propertyPlaceholder id="properties"
location="file:/usr/config/properties/params.properties" />
...

<property name="retryLimit" value="{{maxRetries.DEV}}" />

*params.properties*
maxRetries.DEV = 10

*Exception:*

org.apache.camel.RuntimeCamelException: java.lang.NumberFormatException: For
input string: "{{maxRetries.DEV}}"

Please help.

Thanks
Bala



--
View this message in context: http://camel.465427.n5.nabble.com/reading-integer-values-from-properties-file-tp5737629.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: reading integer values from properties file

Posted by bxkrish <ba...@gmail.com>.
Hi Christian,

Thanks for the suggestion. I tried removing the spaces but it didn't work.

I was hoping for some help if I am making any syntax mistakes. 

I am referring to this help from Camel.
http://camel.apache.org/using-propertyplaceholder.html. 

They mentioned how to access an xs:int property (available as of Camel 2.7)
but I am not sure how to use that syntax in my case with Camel 2.4. I am
sure int properties access would have been a requirement in Camel 2.4 as
well. 

May be switching to the latest Camel version is probably the best approach
here.

Thanks
Bala






--
View this message in context: http://camel.465427.n5.nabble.com/reading-integer-values-from-properties-file-tp5737629p5737704.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: reading integer values from properties file

Posted by Christian Müller <ch...@gmail.com>.
What Willem say is, Camel 2.4.0, which was released more than 3 years ago
[1], isn't supported at Apache any more. If you need a fix for this
version, you have to do it by yourself or by choosing professional support.

You could try whether it works by removing the leading and trailing spaces.

[1] https://issues.apache.org/jira/browse/CAMEL/fixforversion/12315688

Best,
Christian
Am 21.08.2013 20:00 schrieb "bxkrish" <ba...@gmail.com>:

> Hi William.
> My product is packaged with Camel 2.4 version and I am not allowed to
> change
> it. Are you implying the Camel version 2.4 cannot support Integer values
> for
> a property?
>
> Thanks
> Bala
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/reading-integer-values-from-properties-file-tp5737629p5737695.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: reading integer values from properties file

Posted by bxkrish <ba...@gmail.com>.
Hi William. 
My product is packaged with Camel 2.4 version and I am not allowed to change
it. Are you implying the Camel version 2.4 cannot support Integer values for
a property?

Thanks
Bala



--
View this message in context: http://camel.465427.n5.nabble.com/reading-integer-values-from-properties-file-tp5737629p5737695.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: reading integer values from properties file

Posted by Willem jiang <wi...@gmail.com>.
Can you try it with the latest Camel?
As you know you don't provide community support for very old version of Camel.


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Wednesday, August 21, 2013 at 7:11 AM, bxkrish wrote:

> Hi  
>  
> I am using Camel API "propertyPlaceholder" to access my properties. All the
> String values are resolved without any issues. Can you please provide any
> insight on reading integer values?  
>  
> Camel Version = 2.4
>  
> *Configuration:*
>  
> <camelContext..>
> <propertyPlaceholder id="properties"
> location="file:/usr/config/properties/params.properties" />
> ...
>  
> <property name="retryLimit" value="{{maxRetries.DEV}}" />
>  
> *params.properties*
> maxRetries.DEV = 10
>  
> *Exception:*
>  
> org.apache.camel.RuntimeCamelException: java.lang.NumberFormatException: For
> input string: "{{maxRetries.DEV}}"
>  
> Please help.
>  
> Thanks
> Bala
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/reading-integer-values-from-properties-file-tp5737629.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).