spring-projects / spring-projects/spring-boot
Revisit Reactive context hierarchy
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
The context hierarchy for reactive support contains a number of classes that do not seem very useful:
ConfigurableReactiveWebApplicationContextseems to be a marker interfaceStandardReactiveWebEnvironmentis just aStandardEnvironmentthat implements the emptyConfigurableReactiveWebEnvironmentmarker interface
There are two distincts reasons for this hierarchy
ConfigurableReactiveWebApplicationContext seems to be only used by ReactiveWebApplicationContextRunner. The bottom line is that the supplier must provide a ConfigurableReactiveWebApplicationContext but what the infrastructure really requires behind the scene is a ConfigurableApplicationContext that can be identified by the conditions as being reactive. Such type does not give you that guarantee as you may have a context that implements ConfigurableReactiveWebApplicationContext but returns an Environment that is not a ConfigurableReactiveWebEnvironment. Perhaps we could remove this in benefit of a check of the environment as that's what our condition is mostly using.
As for the environment itself, a SpringBootEnvironment that is a StandardEnvironment and has a WebApplicationType accessor would be enough for most use cases except the servlet one. Rather than creating a complete hierarchy for that, maybe we should simply create such dedicated environment and check for its presence in the conditions?
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 by tracing ConfigurableReactiveWebApplicationContext, StandardReactiveWebEnvironment, ConfigurableReactiveWebEnvironment, and ReactiveWebApplicationContextRunner, then inspect how the conditions identify reactive contexts. Done means reaching agreement on a simpler hierarchy or environment design and updating the affected infrastructure and condition checks consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100