Add application listener to locate property sources during bootstrap#1228
Conversation
|
Partial fix for spring-cloud/spring-cloud-config#1922 |
|
Profiles from the bootstrap context get applied to the child context here This all happens after the environment is prepared when config data runs. And here is where the parent context is set |
45c6e71 to
1fa3b25
Compare
Also adds support for activating profiles using spring.profiles.active from bootstrap property source listeners. Allow profiles to be passed from bootstrap context to main application context
1fa3b25 to
296453f
Compare
Also adds support for activating profiles using spring.profiles.active from bootstrap property source listeners. Allow profiles to be passed from bootstrap context to main application context Updating version in docs
… of github.com:ryanjbaxter/spring-cloud-commons into run-bootstrap-propertysource-locators-during-bootstrap
| // environment. This allows any profiles activated during bootstrap to be | ||
| // activated when | ||
| // config data runs in the main application context. | ||
| environment.setActiveProfiles(context.getEnvironment().getActiveProfiles()); |
There was a problem hiding this comment.
@ryanjbaxter Is it possible to bind configurations like spring.main and spring.banner within this code segment? These configurations work when loaded through ConfigDataEnvironmentPostProcessor, but they do not take effect when loaded through BootstrapApplicationListener. It appears that the issue might be because PropertySourceBootstrapConfiguration is actually executed in the main context's initializer.
Also adds support for activating profiles using spring.profiles.active from bootstrap property source listeners.