Is there any way to reduce the handling time for the first request? #269
Answered
by
fugerit79
alantorviq
asked this question in
Q&A
-
I tried to create a base demo project with the online playground. It is a simple spring boot project. |
Beta Was this translation helpful? Give feedback.
Answered by
fugerit79
Dec 15, 2024
Replies: 1 comment 1 reply
-
Hello, thanks for your question, you can try the eager initialization. Here is an example with quarkus. While here is a similar example with spring boot : package org.fugerit.java.demo;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import org.fugerit.java.doc.base.config.InitHandler;
@Component
public class AppInit implements InitializingBean {
@Autowired
private Environment environment;
@Autowired
DocInit docInit;
@Override
public void afterPropertiesSet() throws Exception {
/*
* This will initialize all the doc handlers using async mode.
* (use method InitHandler.initDocAll() for synced startup)
*/
InitHandler.initDocAllAsync(
docHelper.getDocProcessConfig().getFacade().handlers() );
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
fugerit79
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, thanks for your question, you can try the eager initialization.
Here is an example with quarkus.
While here is a similar example with spring boot :