Skip to content

Add a registry to support long lived instances during environment processing #22956

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

Closed
philwebb opened this issue Aug 14, 2020 · 1 comment
Closed
Assignees
Labels
theme: config-data Issues related to the configuration theme type: enhancement A general enhancement
Milestone

Comments

@philwebb
Copy link
Member

Currently ConfigDataLocationResolver and ConfigDataLoader only support ephemeral connections and object instances. For some technologies, these might be expensive to create. It would be helpful if we could provide some mechanism to manage the lifecycle of such instances. It would also be nice if they could sometimes get converted into true bean instances that can be registered in the application context.

@philwebb philwebb added this to the 2.4.x milestone Aug 14, 2020
@philwebb philwebb self-assigned this Aug 14, 2020
@philwebb philwebb added the type: enhancement A general enhancement label Aug 14, 2020
@spencergibb
Copy link
Member

The specific request is to support vault's session (/cc @mp911de) in spring cloud vault and a curator connection in spring cloud zookeeper. This may be applicable for other future config data implementations in GCP, Azure, AWS or Alibaba (which all have spring cloud PropertySourceLocator implementations right now).

@philwebb philwebb added the theme: config-data Issues related to the configuration theme label Aug 20, 2020
@philwebb philwebb changed the title Allow long lived instances during config loading Add a registry to support long lived instances during environment processing Aug 21, 2020
philwebb added a commit that referenced this issue Aug 21, 2020
Add a simple `BootstrapRegistry` that can be used to store and share
object instances across `EnvironmentPostProcessors`. The registry
can be injected into the constructor of any `EnvironmentPostProcessor`.

Registrations can also perform additional actions when the
`ApplicationContext` has been prepared. For example, they could register
the the bootstrap instances as beans so that they become available to
the application.

See gh-22956
@philwebb philwebb modified the milestones: 2.4.x, 2.4.0-M3 Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: config-data Issues related to the configuration theme type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants