We are using PlayFramework to develop a Java APIS.
The problem we are facing when we call the WS api for getting the data from third party API.
private Stream<PostData> select(EntityManager em) {
myClient.doGetCall(); //Rest api call 1
myClient.doGetCall(); //Rest api call 2
myClient.doGetCall(); //Rest api call 3
myClient.doGetCall(); //Rest api call 4
System.out.println("done");
TypedQuery<PostData> query = em.createQuery("SELECT p FROM PostData p", PostData.class);
return query.getResultList().stream();
}
When we call this API, it gives 504 time out. But if I call single api it works
private Stream<PostData> select(EntityManager em) {
System.out.println("done");
myClient.doGetCall(); //Rest api call 1
TypedQuery<PostData> query = em.createQuery("SELECT p FROM PostData p", PostData.class);
return query.getResultList().stream();
}
So the error is not coming in the internal api call using WS. But error is coming in the main REST-API developed in the play-framework.
Not sure what wrong in the this. Please help us out. Thanks in advance.