spring-cloud / spring-cloud/spring-cloud-consul

Wrong priority order of multiple configs in bootstrap mode

Open
#798 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
Dominant language
Java
Stars
822
Forks
539
Avg merge
9h 31m
Merged PRs (30d)
7

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce bootstrap mode and inspect the /actuator/env API using the configuration ordering shown in the issue; compare it with spring.config.import behavior. Trace the Spring Cloud Consul bootstrap configuration loading path, then verify that the four entries resolve in the stated priority order.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.