Closed larsgrefer closed 11 months ago
But since #1213 this should no longer matter correct?
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
@ryanjbaxter #1213 will hide this, yes
After discussing this with the team we view #1213 as a fix for the issue so this can be closed
Describe the bug
BootstrapConfigFileApplicationListener can't handle
spring.config.additional-location
s withoptional:
prefixes.When setting
spring.config.additional-location
tooptional:file:/foo
oroptional:/bar
, https://github.com/spring-cloud/spring-cloud-commons/blob/1a387e1e39d3ce5f2b6a32668eb8ede9e24154d4/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/BootstrapConfigFileApplicationListener.java#L701-L718 will turn these locations intofile:optional:file:/foo
andfile:optional:/bar
.The following code will then decide that the Resource
file:optional:file:/foo/application.properties
does not exist, (whilefile:/foo/application.properties
would exist) https://github.com/spring-cloud/spring-cloud-commons/blob/1a387e1e39d3ce5f2b6a32668eb8ede9e24154d4/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/BootstrapConfigFileApplicationListener.java#L501-L508This can cause ordering issues between internal and external configuration files, depending on the execution order of
BootstrapConfigFileApplicationListener
andConfigDataEnvironmentPostProcessor
(so #1213 will hide this problem)When
BootstrapConfigFileApplicationListener
runs first, we get this order:BootstrapConfigFileApplicationListener
)ConfigDataEnvironmentPostProcessor
)ConfigDataEnvironmentPostProcessor
)When
ConfigDataEnvironmentPostProcessor
runs first, we get this order:ConfigDataEnvironmentPostProcessor
)ConfigDataEnvironmentPostProcessor
)BootstrapConfigFileApplicationListener
)In the first case, the internal properites suddenly get precedence before the external ones.