This question is with regard to play! java 2.6.x
I am attempting to bootstrap some initialization code which needs to be executed during application startup
As per documentation, I have a class called Module in root package
public class Module extends AbstractModule {
private final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger("application");
@Override
public void configure() {
logger.info("Loading Modules");
bind(ConsumerBootstrap.class).asEagerSingleton();
}
}
However it is not behaving as expected. The binding only occurs when I trigger a request on a specific route, rather than eager binding on application startup.
I am running the application using sbt run
Am I missing anything ?
As said : This is by design. If you want to see it in action from sbt, run sbt testProd instead of sbt run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With