Spring Cloud Configuration Server without Spring Download

I looked at the spring -cloud-config client without Spring Boot and many others and did not find a convincing answer. So here it is again:

Question : Is it possible in a Spring application to use Spring Cloud Config server / client without automatically configuring Spring Boot? Does Spring use a boot requirement to use these frameworks?

If this:

  • Is there any documentation that clearly describes what needs to be done to enable Spring Server / Cloud Config Client without Spring Download?
  • Is there any sample project that clearly describes what needs to be done to enable Spring Cloud Config Server / Client without Spring Boot?
+4
source share
1 answer

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.

+3
source

Source: https://habr.com/ru/post/1630023/


All Articles