spring-cloud / spring-cloud/spring-cloud-config

Application- and profile-specific configuration usage - undocumented or not meant to be used?

Open
#1,868 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
Java
Stars
2k
Forks
1.3k
Avg merge
2d 59m
Merged PRs (30d)
16

Description

We are currently using a feature of the Spring Cloud Config server that I find quite neat, which is using an application- and profile-specific .yml file on the Config server side that is named ${spring.application.name}-<profile>.yml.

This is allowed through the use of the:

@RequestMapping(path = "/{name}/{profiles}/{label:.*}",
		produces = EnvironmentMediaType.V2_JSON)
public Environment labelledIncludeOrigin(@PathVariable String name,
		@PathVariable String profiles, @PathVariable String label) {
	return getEnvironment(name, profiles, label, true);
}

endpoint. This feature allows some very nice configuration setups (e.g. separate DataSource properties for separate applications, neatly separated from each other). So, for example:

config/
    application.yml                     # Standard properties
    application-${profile}.yml          # Profile relevant settings
    book-service.yml                    # Standard properties for "book-service" only
    book-service-${profile}.yml         # Profile-specific settings for "book-service" only

However, I cannot find any documentation for this feature. Seeing how the endpoint exists, I am assuming that it was meant to be used. Is this a documentation oversight (which I can gladly make a PR for), or was there an intention to deprecate this endpoint at some time?

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

Start with the Spring Cloud Config server endpoint shown in the issue and the existing configuration-server documentation. Confirm whether application- and profile-specific filenames are supported or intended for deprecation; done means documenting the supported behavior or clarifying its status.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.