Play framework version: 2.3.x
Problem:
Application A is using WS.url to call an endpoint in Application B. The endpoint in Application B took more than 2 mins to respond.
And we got the exception like this:
java.util.concurrent.TimeoutException: Idle connection timeout to ip-xxxxxxxx/127.0.0.1:9000 of 120000 ms
Resolution:
add this line in application.conf
ws.timeout.idle=600000
the unit above is ms so that the idle connection timeout is enlarged.
One way to test if this setting is working is:
Set this timeout to a small value like 6000, and add a Thread.sleep(7000) in the endpoint of Application B
You can get the above exception after 6 seconds when the endpoint of Application B is called.
Please be noted that Idle connection timeout is different with a http timeout. So only by setting WS.url(someUrl).setTimeout(60 * 1000) is useless.