If you do significant work within a listener for a this will slow down you startup time. |
The following example defines a ApplicationEventListener that listens for :
Listening for Server Startup Events
Alternatively, you can also use the @EventListener annotation on a method of any existing bean that accepts :
import io.micronaut.runtime.server.event.*;
import io.micronaut.runtime.event.annotation.*;
public class MyBean {
@EventListener
// logic here
...
}