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

Global/Common application configuration files are skipped when we have any serviceId starting with "application"

Open gsamartian opened this issue 8 years ago • 4 comments

We are using Spring Boot 1.5.9 and Spring Cloud Edgeware.SR2 in our environment.

We have the config repo as folder based for each service and within the folder we have environment specific config files.

When we try to fetch the configuration of a service via config server for a service which is prefixed with "application" it skips fetching the configuration for application.yml and application-.yml and only fetches the service specific configuration.

We have multiple serviceId which are prefixed with application, like application-detail-service,application-metrics-service and so on in our environment.

I am not sure if this a bug with spring cloud config or is a known standard to be followed that we should not prefix any serviceId with "application". Since, I did not find the docs having anything on this wanted to check if it is an issue or not.

To reproduce the issue I have created a demo config service which has backing storage in another repo demo-config-repo as below.

https://github.com/gsamartian/demo-config-service https://github.com/gsamartian/demo-config-repo

The demo-config-repo also contains the log file obtained when fetched the configurations using TRACE log level.

Let me know if you need any more details.

gsamartian avatar Mar 15 '18 19:03 gsamartian

application is the default spring.config.name and is used by config server as a marker for configuration files that are global to all applications.

It is documented here http://cloud.spring.io/spring-cloud-static/spring-cloud-config/1.4.2.RELEASE/single/spring-cloud-config.html#_sharing_configuration_with_all_applications

spencergibb avatar Mar 15 '18 19:03 spencergibb

@spencergibb I am sorry i do not get what you mean.

Do you mean we can override the default and then have serviceid iike those i have in my environment such as application-metrics-service and so on. (OR) we should not use application as a prefix when using as a serviceid for applications ?

gsamartian avatar Mar 15 '18 20:03 gsamartian

we should not use application as a prefix when using as a serviceid for applications

spencergibb avatar Mar 15 '18 20:03 spencergibb

@spencergibb Thanks for clarifying. This issue can be closed.

gsamartian avatar Mar 16 '18 11:03 gsamartian