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}-file-poll.properties"/>

and then have three separate properties file dev-file-poll.properties,
test-file-poll.properties,etc. 

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

--
View this message in context: 
http://camel.465427.n5.nabble.com/Recursive-Property-Placeholder-tp4727692p4727692.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to