spring-cloud / spring-cloud-consul

Spring Cloud Consul
http://cloud.spring.io/spring-cloud-consul/
Apache License 2.0
813 stars 541 forks source link

Wrong priority order of multiple configs in bootstrap mode #798

Open woshikid opened 1 year ago

woshikid commented 1 year ago

When using Spring Cloud Config, the priority order of multiple configs is as follow: (both import mode and bootstrap mode)

1. configserver:foo-dev.yml
2. configserver:application-dev.yml
3. configserver:foo.yml
4. configserver:application.yml

and Spring Cloud Consul Config take a similar order when using spring.config.import

1. consul:config/foo,dev/data
2. consul:config/application,dev/data
3. consul:config/foo/data
4. consul:config/application/data

BUT when using bootstrap mode, the client load configs in a strange priority order:

1. consul:config/foo,dev/data
2. consul:config/foo/data
3. consul:config/application,dev/data
4. consul:config/application/data

this can be confirmed by using /actuator/env api.