You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by fjaouen <fr...@accovia.com> on 2009/07/20 21:31:40 UTC
constant in setProperty is not compatible with property-placeholder
Spring context
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 ?
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.
Re: constant in setProperty is not compatible with
property-placeholder Spring context
Posted by Claus Ibsen <cl...@gmail.com>.
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
Re: constant in setProperty is not compatible with
property-placeholder Spring context
Posted by fjaouen <fr...@accovia.com>.
Yes my propertyPlaceHolder is set because I also use it like you for my JMS
queue.
But my question is not about the queue but about the camel:constant.
It is not the same thing. If you look at the Camel code you would understand
my question.
hzbarcea wrote:
>
> Yeah we use this all the time
> http://camel.apache.org/how-do-i-use-spring-property-placeholder-with-camel-xml.html
>
> Do you have your PropertyPlaceholderConfigurer properly defined?
>
> Hadrian
>
> On Jul 20, 2009, at 3:31 PM, fjaouen 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 ?
>>
>> 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.
>>
>
>
>
--
View this message in context: http://www.nabble.com/constant-in-setProperty-is-not-compatible-with-property-placeholder-Spring-context-tp24576074p24576350.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: constant in setProperty is not compatible with property-placeholder Spring context
Posted by Hadrian Zbarcea <hz...@gmail.com>.
Yeah we use this all the time
http://camel.apache.org/how-do-i-use-spring-property-placeholder-with-camel-xml.html
Do you have your PropertyPlaceholderConfigurer properly defined?
Hadrian
On Jul 20, 2009, at 3:31 PM, fjaouen 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 ?
>
> 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.
>