-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Clarify configuration lite support and offer an opt-in option #22461
Comments
I'd like to echo Stephane's dislike of using In terms of the benefits of not proxying @philwebb raised another benefit of being able to identify a configuration class where |
While discussing this with @wilkinsona, I proposed we name the boolean flag in He came back with " I tend to like |
I have an implementation ready to be committed now, using a Whatever we may feel about it, I can't see how we'd limit As for the annotation detection overhead, let's tackle this along with our other issues for it. Once we have a method-level indication in the components index, we'll get efficient skipping not only for |
Really pleased to see this land. Thanks! |
@jhoeller, shall we reopen this issue to update the Reference Manual, or are you planning on doing that in a new issue? |
I've noticed an interesting side-effect of this change that I hadn't anticipated. When I switch from |
@wilkinsona A strange effect indeed, I'll have a look at it this morning... I'm into that area anyway with the remainder of #22420. |
@wilkinsona Since you're seeing the |
No, the methods aren't |
I can see why this would happen: The enhancement step for the generated subclass resolves the bean |
Thanks. Yes, now I look more closely, this is indeed the bean definition for the configuration class itself. Sorry for the inaccuracy in the description above. |
The part with static |
A configuration's bean |
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.
The Spring Boot team has been investigating startup time improvements by not relying on the proxy capabilities of configuration classes. Turns out that not using that stuff (basically switching all auto-configurations and related imports to "lite mode") makes quite a difference spring-projects/spring-boot#9068 (comment)
I am not a big fan that we were looking for
@Bean
methods in any component, treating them in lite mode if they don't have the@Configuration
stereotype. I was wondering if we would be open to revisit this in the 5.2 line.Being able to opt-out from the proxy mode using the
@Configuration
stereotype would be ideal. We are not keen to remove@Configuration
and use the lite mode as it stands as:Having a way to opt-out would be also a nice opportunity to clarify the behaviour and stop scanning components for bean factory methods.
The text was updated successfully, but these errors were encountered: