I have the following in my controller, in a Spring-Boot application:
@RequestMapping(method=RequestMethod.GET,value=\"/info\")
public DataModel getinfodata()
Eventually, I figured out why it is happening The dev-server makes use http-proxy-middleware package More Here and the proxy options provided in this package is from underlying http-proxy library http-proxy options.
one among them is
proxyTimeout:
timeout (in millis) when the proxy receives no response
The default value is ~120 seconds(based on my observations) if the server fails to respond within the stipulated time(120s) a new request is made to the server.
overriding the default timeout with "timeout":30000 in proxy config file resolved the issue.
{
"/info": {
"target": {
"host": "localhost",
"protocol": "http:",
"port": 8080
},
"secure": false,
"changeOrigin": true,
"logLevel": "debug",
"timeout":30000
}
}