-
Notifications
You must be signed in to change notification settings - Fork 705
Add application listener to locate property sources during bootstrap #1228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.