if you use the Spring properties you need to refer to properties using the
Spring ${} interpolation syntax

but if you choose to use the Camel properties component you must use the {{
}} interpolation syntax
in that latter case its better to use the

<camelContext ...>
   <propertyPlaceholder id="properties" location="classpath:<java path
to/>my.properties"/>


<camel:threadPoolProfile defaultProfile="true"
                       id="customThreadPool"
poolSize="{{threadPool.defaultPoolSize}}"
maxPoolSize="{{threadPool.maxPoolSize}}"
/>

</camelContext>




On Fri, May 18, 2012 at 3:07 PM, javaxmlsoapdev <[email protected]>wrote:

> I have defined "properties" bean of type camel PropertiesComponent as shown
> below. "my.properties" has
> threadPool.defaultSize and threadPool.maxPoolSize properties defined.
> However camel threadPoolProfile isn't able to recognize those properties
> and
> keep complaining as follow.
>
> Any idea?
>
> <bean id="properties"
>
>  class="org.apache.camel.component.properties.PropertiesComponent">
>                <property name="location" value="classpath:my.properties" />
>        </bean>
>
>        <camel:camelContext id="camelContext">
>
>                <camel:contextScan></camel:contextScan>
>                <camel:threadPoolProfile defaultProfile="true"
>                        id="customThreadPool"
> poolSize="threadPool.defaultPoolSize"
> maxPoolSize="threadPool.maxPoolSize" />
>        </camel:camelContext>
>
> Caused by: java.lang.NumberFormatException: For input string:
> "threadPool.defaultPoolSize"
>        at
>
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
>        at java.lang.Integer.parseInt(Integer.java:447)
>        at java.lang.Integer.valueOf(Integer.java:553)
>        at
>
> org.apache.camel.converter.ObjectConverter.toInteger(ObjectConverter.java:250)
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Unable-to-read-properties-from-camel-PropertiesComponent-tp5711888.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to