spring-bootspring-cloud-configspring-cloud-netflix

How to make configuration with discovery first lookup work with spring cloud 2022.0.3


I've spent quite a few hours scratching my head on this one, digging through the documentation, migration guides, release notes, but can not get an application to get it's config from a configserver found through eureka : it works perfectly with boot 2.7.13/Cloud 2021.0.8, but fails with boot 3.1.1/Cloud 2022.0.3.

I put a really simple project here : https://github.com/snussbaumer/spring-cloud-config-discovery-first-sample.

The main branch is spring boot 3, there is also a main-spring-boot-2 branch with the spring boot 2 version that works. The diff is really only versions in poms : snussbaumer/spring-cloud-config-discovery-first-sample@main...main-spring-boot-2

I've also posted an issue on https://github.com/spring-cloud/spring-cloud-config/issues/2303, but it dit not get much traction there. I tried debugging through the thing but it's not a simple endeavour ... I've been through much of spring code but here I'm a bit lost.


Solution

  • There was a problem in Spring Cloud 2022.0.3 as stated here :

    There is a known defect in Spring Cloud Config related to locating the config server via service discovery. In order to activate this feature in this release you will need to set spring.cloud.config.discovery.enabled=true and spring.cloud.config.discovery.serviceId in an environment variable or as a system property. This bug will be addressed in the next release.

    The problem has been fixed in Spring Cloud 2022.0.4.