I've been trying to fix a really annoying problem in a Java Web project. We use Spring (3.1.4) with webflow (2.3.1), running over Wildfly 11.0 on a Amazon Server. In short, the remote server is giving 504 - Timeout error for a task that the local environment doesn't.
An specific page exports a .xls report which internally do a lot of work in consulting database and other aplication REST APIs. This functionality is inside a ManagedBean like so:
@org.springframework.stereotype.Component
@Scope(value = "request")
public class ReportMB {
...
public void export(){
try{
// code goes here
// generates HttpServletResponse containing the report file
} catch (...) {...}
}
This report is successfully generated in my development machine even if I choose too many data to be included, although it takes up to few minutes to complete. When it runs on the remote server, with the same Wildfly version and project deployment, we get 504 - Timeout with far less data in under 100 seconds.
I've already examined the logs and even debugged the proccess (locally), and both environments (local and remote) do not thow any exception. Do you have any clue why the local server waits until the function finishes and the file gets ready but the remote server doesn't, or at least do you have an idea on how to increase the Wildfly/Spring timeout tolerance for this request? (I have seen many examples of changing the deployment timeout but nothing related to the request timeout)
Thank you in advance.
The 504 will be being created by the loadbalancer not the app server. Increase the timeout on the loadbalancer