Skip to content

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

Closed
@bclozel

Description

@bclozel

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

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: taskA general task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions