I have a classX in my spring application in which I want to be able to find out if all spring beans have been initialized. To do this, I am trying to listen ContextRefreshedEven
I will prefer ApplicationReadyEvent. I found ContextRefreshedEvent is called before my http server is started. ApplicationReadyEvent will make sure your application is ready to take request.
@EventListener(ApplicationReadyEvent.class)
public void startApp() {
LOGGER.info("Application is now ready!");
}