I have a Spring Boot app that I just migrated from 2.3.6 to 2.4.0. After deploying my app to my DEV environment I don't see it pulling its configuration from my Spring Cloud Config Server (Git repo). After searching I find that with the new release I have to add a new dependency (spring-cloud-starter-bootstrap). Now it reads from the Spring Cloud Config Server but it's not using the properties from the file.
I have 2 resources files a application.yml and a bootstrap.yml
This is my bootstrap.yml:
spring:
application:
name: jquest
cloud:
config:
enabled: true
fail-fast: false
uri: http://config-service:8080
retry:
max-interval: 6000
max-attempts: 10
initial-interval: 6000
Do I have to add something to my application.yml file so my Spring Boot app uses the properties from the fetched configuration??
Thanks
Comment From: scottfrederick
What version of Spring Cloud Config are you using? Spring Cloud 2020.0.0-M6 has been released, with improved compatibility with Spring Boot 2.4.0. Please upgrade to that Spring Cloud version if you haven't already.
If you have further issues with Spring Cloud Config after upgrading, please open an issue in the Spring Cloud Config project or ask a question on Stackoverflow using the spring-cloud
tag.
Comment From: mrksph
I'm using Spring Cloud Config 2020.0.0-M5 The only thing related to this I can see in the wiki is something about Spring Boot not pulling the file if spring-cloud-starter-bootstrap dependency is not added. After adding this dependency my app starts to fetch the file again but is not using its properties, for example it tries to connect to localhost instead of the configured database uri.
Comment From: spencergibb
https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2020.0-Release-Notes#breaking-changes
Comment From: mrksph
Hi, thanks for linking the wiki but I don't see clearly where it says spring boot needs more configuration or something like that
Comment From: spencergibb
Read about using spring.config.import and how bootstrap is now opt in
Comment From: mrksph
Ah okay, thank you!