spring-projects / spring-projects/spring-boot

Expose the functional bean registration API via SpringApplication

Open
#8,115 41 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

theme: performance type: enhancement
Dominant language
Java
Stars
81.5k
Forks
42.7k
Avg merge
2d 4h
Merged PRs (30d)
65

Description

SpringApplication makes it hard to get hold of the application context before it's refreshed. @michael-simons came up with this:

SpringApplication springApplication = new SpringApplication(Application.class);
springApplication.addInitializers((GenericApplicationContext ctx) -> {
    ctx.registerBean(Greeter.class, Greeter::new);
});
springApplication.run(args);

It would be nice if the initialiser wasn't needed and the API provided an easier way to access the context before it's refreshed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading SpringApplication and its addInitializers API, then inspect how the application context is created and refreshed. The issue is complete when the functional bean registration API can be used through SpringApplication before refresh without requiring an initializer, with coverage for the proposed registration flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.