spring-projects / spring-projects/spring-boot
Allow spring.factories instances to be changed, configured or removed
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
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));
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with SpringApplication's loading of instances from spring.factories, then review LoggingApplicationListener and its setParseArgs method. Read the example in #24878 to understand removal needs. Done should allow loaded instances to be changed, configured, or removed through the proposed customization mechanism.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100