https://stackoverflow.com/questions/73111865/spring-cloud-config-changes-to-make-it-available-to-all-spring-cloud-config-cl

We have large number of microservices which are spring cloud config client. Each of them have bootstrap.properties which contains configuration for config server, such as URI, Username, Password for config server.

We want to overcome a problem where config client starts without actually getting the specific property resource file from config server ( some of the cases are config server was not available when client was getting started.)

So to overcome this I am thinking to use this configuration spring.cloud.config.failFast=true or to enable retry

I can do that in the bootstrap.properties for specific cloud config client or microservice.

But We have so many of them and editing the bootstrap.properties seems too much overhead

Does anyone has any other solution to the problem? Or to apply above solution in any other place. I am looking for a centralized solution.

Comment From: ryanjbaxter

What version of Spring Boot and Spring Cloud are you using?

Just to clarify, you want to application to fail at startup if it cant reach the config server?

Comment From: viral-kondhia

Yes I want to fail the client application or retry connection to config server

<spring.version>2.4.4</spring.version> <spring.cloud.version>2020.0.2</spring.cloud.version> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot</artifactId> <version>2.4.4</version> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-bootstrap</artifactId> <version>3.0.2</version> </dependency> <dependency> <groupId>org.springframework.retry</groupId> <artifactId>spring-retry</artifactId> <version>1.3.1</version> </dependency>

Comment From: ryanjbaxter

Any chance you can move to use newer releases? Both the boot and cloud versions you are using are not supported any longer (and are also are not the latest releases)

I think the ideal way to deal with this is to use spring.config.import and no longer use bootstrap https://docs.spring.io/spring-cloud-config/docs/3.0.5/reference/html/#config-data-import

Comment From: viral-kondhia

I can try that but that will again put me in the same condition of changing the properties/config files for all the microservices Which is the situation I want to avoid considering the number of configuration files are very high.

Comment From: ryanjbaxter

Understood. But in essence you would replace spring.cloud.config.uri with spring.config.import but it would fail if it can't reach the config server.

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.