Skip to content

Allow spring.factory instances to be changed, configured or removed #24947

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

Open
philwebb opened this issue Jan 20, 2021 · 2 comments
Open

Allow spring.factory instances to be changed, configured or removed #24947

philwebb opened this issue Jan 20, 2021 · 2 comments
Labels
status: pending-design-work Needs design work before any code can be developed type: enhancement A general enhancement

Comments

@philwebb
Copy link
Member

philwebb commented Jan 20, 2021

When SpringApplication loads instances via spring.factories it's quite hard to change, customize or remove them. Often users need to resort to a BeanFactoryPostProcessor or the like.

For example, the LoggingApplicationListener has a setParseArgs method, but it's very hard to actually call it.

Another example is documented in #24878 where specific listeners needed to be removed.

We might be able to offer a Customizer interface that would allow instances to be changed to removed. Something like:

SpringApplication application = new StringApplication(MyApp.class);
application.addSpringFactoryInstanceCustomizer((LoggingApplicationListener) listener -> listener.setParseArgs(false));
@philwebb philwebb added this to the General Backlog milestone Jan 20, 2021
@philwebb philwebb added the type: enhancement A general enhancement label Jan 20, 2021
@Tharik67
Copy link

Hi, can i try working on this one?

@philwebb philwebb added the for: team-meeting An issue we'd like to discuss as a team to make progress label Nov 18, 2021
@snicoll
Copy link
Member

snicoll commented Nov 18, 2021

@Tharik67 thanks for the offer but we're not quite sure how we would approach this. I've added a label to make that more clear.

@snicoll snicoll added the status: pending-design-work Needs design work before any code can be developed label Nov 18, 2021
@philwebb philwebb removed the for: team-meeting An issue we'd like to discuss as a team to make progress label Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: pending-design-work Needs design work before any code can be developed type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants