Asynchronous initialization of Spring beans #23294
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: duplicate
A duplicate of another issue
type: enhancement
A general enhancement
As the most people's problems, we have come to the same confusion. Our project has about 1,000 beans, but the startup time has been close to 10 minutes. Every time we fix a bug and do an integrated deployment, it takes a long time to wait. There are two Suggestions could be taken into consideration.
On the basis of existing source code, the initialization of beans with
init method
orafterPropetiesSet
left to the thread pool, but the dependency safety must be ensured, such asA->B
, but B is not initialized. We can give each Bean a proxy, ensureB
initialized at first through the way of intercepting the proxy's methods.Static analysis of dependencies between beans generates multiple graphs.
Issue Links:
#13410 Parallel bean initialization during startup [SPR-8767]
#19487 Asynchronous initialization of beans during startup [SPR-14920]
The text was updated successfully, but these errors were encountered: