Dear community,

I’m trying to use system variables in Properties Component locations and it 
doesn’t work. Here is some details:


  1.  Spring beans:

<bean 
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" 
id="PropertyPlaceholder">

        <property name="locations">

            <list>

                <value>classpath:**/application.properties</value>

                
<value>classpath:**/application-${spring.profiles.active}.properties</value>

            </list>

        </property>

</bean>

<bean class="org.apache.camel.component.properties.PropertiesComponent">

        <property name="location" 
value="classpath:application-${spring.profiles.active}.properties"/>

</bean>

  1.  Spring application.properties(as default value):

spring.profiles.active=local

  1.  VM options:
-Dspring.profiles.active=dev

I meant to use application-dev.properties. But actually camel used 
application-local.properties while spring used application-dev.properties.

My hope is to hear from anyone who can help to figure out what’s wrong.

My reference: 
https://camel.apache.org/manual/latest/using-propertyplaceholder.html#UsingPropertyPlaceholder-UsingSystemandEnvironmentVariablesinLocations




Regards,
Jane

Reply via email to