Skip lazy init for beans that explicitly set lazy to false
This commit also adds tests to ensure that the child management context works when lazy initialization is enabled. Also, it adds a BeanFactoryPostProcessor to the child context so that the server is created and listening for requests but other beans in the child context are not created until requested. See gh-16184
This commit is contained in:
@@ -119,6 +119,10 @@ on `SpringApplicationBuilder` or the `setLazyInitialization` method on
|
||||
spring.main.lazy-initialization=true
|
||||
----
|
||||
|
||||
TIP: If you want to disable lazy initialization for certain beans while using lazy
|
||||
initialization for the rest of the application, you can explicitly set their lazy attribute
|
||||
to false using the `@Lazy(false)` annotation.
|
||||
|
||||
|
||||
|
||||
[[boot-features-banner]]
|
||||
|
||||
Reference in New Issue
Block a user