I have wrote spring rest Async controller, that return String JSON response, When I request the browser complete the response, while the controller have not completed the processing hence the response is not ready.
I am using Spring Boot, Apache as inbuilt server. In EmbeddedServletContainerFactory I have set AsyncTimeout too.
TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
@Override
public void customize(Connector connector) {
connector.setAsyncTimeout(10000000);
}
});
so How I make the browser wait while the controller Async'ly complete the response?
And the controller is
@Async
@RequestMapping(value = "/id", method = RequestMethod.GET)
public String getDetails(@PathVariable("id") String id) {
// wrote logic for JSON response....
}