Beans are created on startup when the application context is created (eagerly). But, lazy beans are created the first time they are used. Its use is not recommended.
@Lazy
@Component("jdbcRepository")
public class JdbcRepositoryImpl implements AppRepository {
...
}
When we put the @Lazy annotation over the @Configuration class, all the methods with @Bean annotation should be loaded lazily.