I have followed all the configuration steps for my WarmupServlet in my app engine project and I see it run at startup, but still I see my first endpoint call as a loading request which takes up to 25 seconds which is absolutely unacceptable. I need to be able to warm up each endpoint individually so that there will be no loading requests. (Apparently just setting up a warmp-up servlet is not enough.) So, my question is, how can I call a method in endpoints so that the endpoint is properly warmed up to serve from my WarmupServlet? I tried below with no success:
MyEndpoint me = new MyEndpoint();
me.getMyEntity(1L);
where
@ApiMethod(name = "getMyEntity")
public MyEntity getMyEntity(@Named("id") Long id) {
EntityManager mgr = getEntityManager();
MyEntity myEntity = null;
try {
myEntity = mgr.find(MyEntity.class, id);
} finally {
mgr.close();
}
return myEntity;
}
After adding the client endpoints jar file as a library, this properly warms up MyEndpoint from the Java backend: