Is your feature request related to a problem? Please describe.
The current documentation clarifies the unexpected behavior when ${spring.application.name}
of an application that uses Spring Cloud Config is prefixed with application-
:
When setting the property ${spring.application.name} do not prefix your app name with the reserved word application- to prevent issues resolving the correct property source.
While this note has proved useful to me in the past, I have seen team members struggle to debug the issue when application name starts with application-
multiple times now. I can imagine others might be in the same boat. For users, who use Spring Config Server everyday, going back to the documentation to find this note might not be very intuitive.
Describe the solution you'd like
(assuming ${spring.application.name}
starts with application-
)
In the Spring Cloud Config Client before sending the request to the server:
- If failfast is enabled, throw an exception indicating application name cannot start with application-
- If failfast is not enabled, log a warning and return an null from ConfigServicePropertySourceLocator.locate(..)
Comment From: spencergibb
Maybe we write an exception analyzer that prints warnings if there application name starts with application.