In the old 2.x.x versions we used the discovery first bootstrap for loading configurations for our services and we wanted to keep this at the new 3.0.x version.
We followed the instructions on your site: https://docs.spring.io/spring-cloud-config/docs/3.0.0/reference/html/#discovery-first-bootstrap but failed to successfully load configurations via the discovery until the bootstrap was enabled.
So, until we added the dependency in our service:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
we couldn't load configurations via the discovery.
We also tried to use the spring.config.use-legacy-processing=true property but without luck.
So did we miss something in the properties or does the bootstrap really needs to be enabled so the discovery first works, and it is just missing in the documentation?
Comment From: ryanjbaxter
From the docs
To use the legacy bootstrap way of connecting to Config Server, bootstrap must be enabled via a property or the spring-cloud-starter-bootstrap starter. The property is spring.cloud.bootstrap.enabled=true. It must be set as a System Property or environment variable.
https://docs.spring.io/spring-cloud-config/docs/3.0.3/reference/html/#config-first-bootstrap
Did you try that property?
Comment From: presjednik
Yeah, at the end we tried that. But we are using Discovery First Bootstrap and in the documentation for that use case, there is no mention of the bootstrap. If the bootstrap needs to be enabled, I think that this should also be mentioned in the https://docs.spring.io/spring-cloud-config/docs/3.0.0/reference/html/#discovery-first-bootstrap part.
If not, is there something else that we need to configure to get the discovery first working?
Comment From: ryanjbaxter
Doesn't this sentence imply that you need to use bootstrap mode?
However, in the default “Config First” mode, clients cannot take advantage of the registration.
I suppose we can reword this to say explicitly that you need to enable bootstrap mode and that config first mode will not work.
Would that be better?
Comment From: presjednik
Ok, so the Discovery First Bootstrap is just a implementation of the "Config First" mode? Shouldn't then the "Discovery First Bootstrap" documentation part be a "subpart" of the "Config First Bootstrap"?
It looked like the "Config First" and "Discovery First" are 2 different modes, and because of that they should be configured differently.
But, yes, it would be better if you explicitly state that the bootstrap mode needs to be enabled.
Comment From: ryanjbaxter
That is a fair point, we could make Discovery First a submodule of config first bootstrap since it will only work under that condition. It was not a problem before since we only had bootstrap mode.
Comment From: ryanjbaxter
Hopefully this clarifies things https://github.com/spring-cloud/spring-cloud-config/blob/master/docs/src/main/asciidoc/spring-cloud-config.adoc#config-first-bootstrap
Comment From: spencergibb
reopening, as this should work.
Comment From: ryanjbaxter
@presjednik was this the error you were seeing?
***************************
APPLICATION FAILED TO START
***************************
Description:
No spring.config.import property has been defined
Action:
Add a spring.config.import=configserver: property to your configuration.
If configuration is not required add spring.config.import=optional:configserver: instead.
To disable this check, set spring.cloud.config.enabled=false or
spring.cloud.config.import-check.enabled=false.
Comment From: spencergibb
We are unable to reproduce this. Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.
Comment From: spring-cloud-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-cloud-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.