Response is sent back very late after setting the DeferredResult setResult method

275 Views Asked by At

I have a REST Controller, implemented using Spring MVC. The controller sets the DeferredResult setResult method with the response received after validations, from the service method.

df.setResult(responseobj);

However, the worker thread is not notified immediately after setting the response and my response is delayed. Using the Chrome debugger I get the below message under the "Network" Tab, against my REST call.

"Caution: request is not finished yet"

However, after a wait of 2 minutes, the status updates to "200" and the response is shown.

0

There are 0 best solutions below