40 lines
1.9 KiB
Plaintext
40 lines
1.9 KiB
Plaintext
![]() |
=== On 2018-04-20T13:58:35Z Alexandre Gigleux Wrote:
|
|||
|
Reference: \https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/autoconfigure/EnableAutoConfiguration.html
|
|||
|
|
|||
|
=== On 2018-06-13T17:55:11Z Andrei Epure Wrote:
|
|||
|
Could this produce many False Positives? How can we tell if there is something to exclude or not?
|
|||
|
|
|||
|
|
|||
|
At least in https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-auto-configuration.html#using-boot-disabling-specific-auto-configuration[the official docs], there's no recommendation to exclude. It's done on a per-need basis, and that need is quite context-specific...
|
|||
|
|
|||
|
=== On 2018-06-13T18:02:25Z Alexandre Gigleux Wrote:
|
|||
|
This rule was inspired by \https://www.alexecollins.com/spring-boot-performance/
|
|||
|
|
|||
|
=== On 2021-03-14T10:30:46.869Z Stéphane Nicoll Wrote:
|
|||
|
Hello,
|
|||
|
|
|||
|
|
|||
|
Spring Boot developer here. The way the rule is described is quite misleading IMO, I'd be curious to understand what led you (besides that blog post) to do this.
|
|||
|
|
|||
|
|
|||
|
This rule sounds like it is a mistake to have a Spring Boot application with ``++@SpringBootApplication. ++``It is the general recommended approach for most apps.
|
|||
|
|
|||
|
|
|||
|
> it may load and configure beans the application will never use and therefore consume more CPU and RAM than really required.
|
|||
|
|
|||
|
|
|||
|
There's quite a gap between "it may" and not recommending users to use that feature at all. A major code smell sounds like something users should pay attention. IMO, the rule the way it is described will point users in the wrong direction.
|
|||
|
|
|||
|
|
|||
|
As for the recommendation of using `@Import`, that's actually inaccurate. Auto-configurations are processed at a specific point of the lifecycle of the application context and using `@Import` imports them in the user config. It can be ok for corner cases (like enabling a specific feature when it was disabled based on a condition) but that's about it. `@ImportAutoConfiguration` exists but is mostly meant for testing purposes.
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|