Skip to content
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

Make Spring web configuration classes use proxyBeanMethods=false by default #23004

Closed
bclozel opened this issue May 20, 2019 · 1 comment
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task
Milestone

Comments

@bclozel
Copy link
Member

bclozel commented May 20, 2019

We originally discussed this in #22596 but we discarded that because we felt it would make the task harder for people to extend those configuration classes (DelegatingWebFluxConfiguration and
DelegatingWebMvcConfiguration).

After discussing that with @wilkinsona , it seems that it's actually the opposite. If a developer extends one of those with an @Configuration class, that new config class will use proxying, even if the parent class has the proxyBeanMethods=false option. On the other hand, a developer looking at these infrastructure classes can't guess that they can be used with a proxyBeanMethods=false setup, or at least they won't get any guarantee on that while reading the source code.

We should add the proxyBeanMethods=false option on these classes because:

  1. This will improve the performance for non-Spring Boot users
  2. This will provide hints to developers extending those classes, telling them that it's safe to use without proxying
  3. This won't break existing use cases are this is opt-in only
@bclozel bclozel added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement labels May 20, 2019
@bclozel bclozel added this to the 5.2 M3 milestone May 20, 2019
@bclozel bclozel self-assigned this May 20, 2019
@bclozel bclozel added type: task A general task and removed type: enhancement A general enhancement labels May 20, 2019
@jhoeller jhoeller changed the title Make Spring web configuration classes use proxyBeanMethods=true by default Make Spring web configuration classes use proxyBeanMethods=false by default May 20, 2019
@rstoyanchev
Copy link
Contributor

rstoyanchev commented May 21, 2019

If a developer extends one of those with an @Configuration class, that new config class will use proxying

Good point. Sounds like there aren't any downsides then. Out of the box is fine, and anything that extends the config has to opt in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants