You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2009/07/24 09:10:49 UTC

Re: constant in setProperty is not compatible with property-placeholder Spring context

On Mon, Jul 20, 2009 at 9:31 PM, fjaouen<fr...@accovia.com> wrote:
>
> Hi,
>
> I want to set a constant which is a Spring context property-placeholder. But
> it seems Camel is not able to deal with ?
>
> For instance I would like to say:
>
> <camel:setProperty propertyName="MYUSERNAME">
>        <camel:constant>${myusername}</camel:constant>
> </camel:setProperty>
>
> Instead of hardcoding it into my Camel configuration like this which is less
> dynamic:
>
> <camel:setProperty propertyName="USERNAME">
>        <camel:constant>john</camel:constant>
> </camel:setProperty>
>
> Is there a way to do it ?
>
No as the spring property placeholder is invoked by spring and its a
bit limited what you can do in Spring 2.5.
There is in fact a JIRA at Spring that James Strachan filed to enhance
this. Maybe its fixed in Spring 3.0.

See this FAQ
http://camel.apache.org/how-do-i-use-spring-property-placeholder-with-camel-xml.html


> Thanks !
> --
> View this message in context: http://www.nabble.com/constant-in-setProperty-is-not-compatible-with-property-placeholder-Spring-context-tp24576074p24576074.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus