spring-cloud-commons icon indicating copy to clipboard operation
spring-cloud-commons copied to clipboard

Bootstrap fails when embedding config server

Open tcbcw opened this issue 2 years ago • 0 comments

When embedding a Cloud Config Server and bootstrapping from that config server, the steps require using the spring.cloud.config.server.bootstrap: true flag. https://cloud.spring.io/spring-cloud-config/multi/multi__embedding_the_config_server.html

However, the bootstrapping has been deprecated and was broken with the fix for #1158 . Previous to this fix, when bootstrapping, two contexts would be created. The top-level was the bootstrap context and the second level was the application's context. The bootstrap context contained the bean for org.springframework.cloud.config.client.ConfigClientProperties, but the application context contained the propertySource for bootstrap.yml.

Before the fix for #1158, the ConfigurationPropertiesRebinder would bind the bean found in the bootstrap context using the application context's propertySources. I agree that this seems wrong, and can cause issues like described in #1158, however, now that the bean and propertySources need to be in the same context, I can't see a way to get an application to bootstrap properly. I believe this is a bug.

The last working version was org.springframework.cloud:spring-cloud-context: 3.1.4.

tcbcw avatar Jul 25 '23 21:07 tcbcw