Spring Cloud Config Server accepts multiple profile and returns the properties for all the profiles when I access the /env endpoint of the application. The response lists the properties specific to each profile. If same property is present in 2 different property files , the one that is defined last takes precedence. Is there a way to get the final list of property key and values that will be used by the application?
We can build the config server endpoint URL in this manner: http://{Config server URL}:{Port}/{ServiceID}/{Profile} So if we want to see all the properties value in config server for the MicroServiceEmployeeSearchService, the URL should be http://localhost:9090/EmployeeSearchService/default.
"Spring cloud config server" provides client-side support for externalized configuration in a distributed system. With the distributed configurations, we have a central place to manage external properties for applications across all environment.
Creating Spring Cloud Configuration Server Gradle users can add the below dependency in your build. gradle file. Now, add the @EnableConfigServer annotation in your main Spring Boot application class file. The @EnableConfigServer annotation makes your Spring Boot application act as a Configuration Server.
For Cloud Config Client Application
I've tried different ways and found the following (accidentally):
GET /env/.*
returns full list of configuration properties
For Cloud Config Server Application
It turns out this is already implemented, but not documented well. All you need is to request json
, yml
or properties
according to the patterns:
/{application}-{profile}.{ext}
/{label}/{application}-{profile}.{ext}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With