-
Notifications
You must be signed in to change notification settings - Fork 38.2k
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
Avoid calling other bean methods in web config #22596
Conversation
In this PR, I'm trying to check what it would take to leverage lite-mode in the web configurations. @jhoeller , @rstoyanchev I'd like to get your opinion on that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The configuration support classes are documented as the "advanced option" for configuring Spring MVC or Spring WebFlux, so this will disrupt some applications using or overriding the protected methods. Fortunately those are few.
What I'm more concerned is that proxyBeanMethods
is false
by default. Applications extending these classes for advanced config would need to be careful not to call bean methods directly which is easy to overlook, and would be surprising. Classes may even run into that by simply upgrading to 5.2 if they already do that. It could also be an optimization that's not actually needed.
Would it make more sense to go with proxied bean methods by default and only set it to false when you're ready and willing to opt in. Boot can certainly turn off the proxying since it is in control of this configuration and guarantee it's done right.
5465a48
to
ee0b04f
Compare
@rstoyanchev you're right - I've changed my PR accordingly. We can still add that |
👍 for that change! |
This commit changes the main configuration classes for Spring MVC and Spring WebFlux to not call other bean methods when setting up the web infrastructure. This allows configuration classes extending `DelegatingWebFluxConfiguration` and `DelegatingWebMvcConfiguration` to opt-in the lite-mode, as introduced in spring-projectsgh-22461.
ee0b04f
to
47c8d1d
Compare
This commit applies changes similar to what's been done in gh-9068, for MVC and WebFlux configurations. This is now possible thanks to the changes done in Spring Framework in spring-projects/spring-framework#22596 Fixes gh-16427
This commit changes the main configuration classes for Spring MVC and
Spring WebFlux to not call other bean methods when setting up the web
infrastructure. This allows the
DelegatingWebFluxConfiguration
andDelegatingWebMvcConfiguration
to opt-in the lite-mode, as introducedin gh-22461.