spring-cloud / spring-cloud/spring-cloud-config
Application- and profile-specific configuration usage - undocumented or not meant to be used?
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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