Loading...

Spring & Spring Boot Annotations Series - #7 - @Lazy Annotation

16,329 views 189________

Hi, welcome to Spring & Spring Boot Annotations Series. In this video, we will learn how to use @Lazy annotation to load the Spring beans lazily (on-demand).

By default, Spring creates all singleton beans eagerly at the startup/bootstrapping of the application context.

You can load the Spring beans lazily (on-demand) using @Lazy annotation.

The @Lazy annotation can be used with @Configuration, @Component, and @Bean annotations.

Eager initialization is recommended: to avoid and detect all possible errors immediately rather than at runtime.

Complete playlist:    • Spring & Spring Boot Annotations  

#spring #springboot #annotations

コメント