Lazy Loading in Spring Core
Lazy Loading in Spring Core
In Spring application by default “application context“ eagerly creates and initializes all singleton scoped beans during application startup itself. It helps in detecting the any bean configuration issues at early stage, in most of the cases. But sometimes, we may need to use some or all beans to be lazy initialized due to different project requirements.
To work with Java side configuration, use @Lazy annotation to load the bean lazily.