I do not know the documentation or the sample project. However, we do this in our projects.
You just need to include the configuration server URI as a resource source if you are using PropertySourcesPlaceholderConfigurer:
<bean class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer" id="propertyPlaceholder">
<property name="locations">
<list>
<value>http://your-config-server.com:8888/application-${spring.profiles.active}.properties</value>
</list>
</property>
<property name="ignoreUnresolvablePlaceholders" value="false"/>
</bean>
You should make sure to pass -Dspring.profiles.active = current_profile to the java command line, as you would probably do with the boot.
source
share