Use events in Spring

Events listener

Run something when application is ready (everything is nicely loaded)

@EventListener(ApplicationReadyEvent.class)
public void doSomethingAfterStartup() {
    System.out.println("hello world, I have just started up");
}