maxmello
04/30/2020, 6:12 PMhttpClient = HttpClient(CIO) {
install(HttpTimeout) {
requestTimeoutMillis = 60000
}
engine {
maxConnectionsCount = 10000
endpoint.apply {
maxConnectionsPerRoute = 1000
pipelineMaxSize = 100
keepAliveTime = 5000
connectTimeout = 5000
connectRetryAttempts = 3
}
}
}
and in my request, I specifically overwrite the requestTimeout:
<http://httpClient.post|httpClient.post><MyResponse> {
url(myUrl)
contentType(ContentType.Application.Json)
timeout {
requestTimeoutMillis = TimeUnit.MINUTES.toMillis(30)
}
body = myBody
}
But I still got a coroutine TimeoutCancellationException
after 15 seconds. I then specified the engine.endpoint.requestTimeout to be longer and the Exception went away - so am I not able to overwrite the CIO engines timeout with the Timeout feature? By the Timeout feature documentation, a HttpRequestTimeoutException
should be thrown, not a Coroutine timeout exception, so it appears to get ignored. Can I overwrite the request timeout for CIO for a specific request? Or should I increase the CIO timeout a lot and then use the HttpTimeout feature to reduce it again?Evan
01/07/2021, 10:10 PMmaxmello
01/08/2021, 8:26 AMJohannes Oehm
01/19/2021, 12:27 PM