camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From boday <>
Subject Re: Recursive Property Placeholder
Date Tue, 23 Aug 2011 18:48:20 GMT
the best way that I've found to do this is to use a default file for common
props and just override the differences in an environment specific file. 
Spring has support for this...

   <bean id="propertyPlaceholderConfigurer"
        <property name="ignoreResourceNotFound" value="true" />
        <property name="locations">

then, you can run your app using -Denv=dev, etc...

Raji wrote:
> It would be nice to have the Property Placeholder support recursive
> substitution. I use this feature in Spring to configure properties for
> various environments. For example:
> db.URL= ${${env}.db.URL}
> dev.db.URL=jdbc:jtds:sqlserver://S08DX01:7531/UserAcnt
> test.db.URL=jdbc:jtds:sqlserver://S08DXK01:1433/UserAcnt
> prod.db.URL=jdbc:jtds:sqlserver://S08DXJ01:8413/UserAcnt
> Then in the JVM launch I just have to use -Denv=dev for the dev
> environment. But this concept does not work for the Camel Property Place
> Holder.  I tried to invoke Spring's Place Holder using the Endpoint URI
> option but there also it fails.
> I can achieve something similar by using the Spring Placeholder to specify
> the name of the properties file for the different environment:
> <propertyPlaceholder id="properties"
> location="classpath:${env}"/>
> and then have three separate properties file,
> I am trying to avoid creating separate properties file for this as it
> becomes a maintenance headache. Probably using the Registry or the
> Blueprint services I can achieve similar results. Any other options?
> Thanks
> Raji

Ben O'Day
IT Consultant -

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message