Scala akka-http 客户端超时错误
Scala akka-http client Timeout error
我有一个使用 Akka 并查询 REST 服务器的 Scala Play 应用程序。请求可能需要很长时间才能响应,我遇到超时:
"The server was not able to produce a timely response to your request. Please try again in a short while!"
我已经尝试使用 Play WSClient 和 kaka-http 客户端并得到相同的错误,我已经设置了我能找到的每个超时 属性。
WSClient 被注入到 Actor 中,我称之为这是在我的 Actor 中
val resp = ws.url("myurl").withRequestTimeout(Duration.Inf).get()
resp pipeTo self
我试过了:
Http().singleRequest(HttpRequest(uri = "myurl"))
然后将其通过管道传递给自己,但仍然超时。
在application.conf中我设置了:
play.ws.timeout.connection = 3600 s
play.ws.timeout.request = 3600 s
play.ws.timeout.idle = 3600 s
akka.http.server.idle-timeout = 3600 s
akka.http.http-connection-pool.idle-timeout = 3600 s
akka.http.http-connection-pool.client.idle-timeout = 3600 s
akka.http.server.request-timeout = 3600 s
akka.http.client.idle-timeout = 3600 s
akka.http.client.connecting-timeout = 3600 s
我不确定我还能做什么。我什至尝试过
Await.resutl(rest, Duration.Inf)
但这于事无补。如果有人对我可以尝试什么有任何想法,将不胜感激。我正在使用 Akka 2.4.4 和 Play 2.5.3。
问题出在服务器端,它也是一个 Akka 应用程序。我已设置服务器连接超时并已解决问题。
我有一个使用 Akka 并查询 REST 服务器的 Scala Play 应用程序。请求可能需要很长时间才能响应,我遇到超时:
"The server was not able to produce a timely response to your request. Please try again in a short while!"
我已经尝试使用 Play WSClient 和 kaka-http 客户端并得到相同的错误,我已经设置了我能找到的每个超时 属性。
WSClient 被注入到 Actor 中,我称之为这是在我的 Actor 中
val resp = ws.url("myurl").withRequestTimeout(Duration.Inf).get()
resp pipeTo self
我试过了:
Http().singleRequest(HttpRequest(uri = "myurl"))
然后将其通过管道传递给自己,但仍然超时。
在application.conf中我设置了:
play.ws.timeout.connection = 3600 s
play.ws.timeout.request = 3600 s
play.ws.timeout.idle = 3600 s
akka.http.server.idle-timeout = 3600 s
akka.http.http-connection-pool.idle-timeout = 3600 s
akka.http.http-connection-pool.client.idle-timeout = 3600 s
akka.http.server.request-timeout = 3600 s
akka.http.client.idle-timeout = 3600 s
akka.http.client.connecting-timeout = 3600 s
我不确定我还能做什么。我什至尝试过
Await.resutl(rest, Duration.Inf)
但这于事无补。如果有人对我可以尝试什么有任何想法,将不胜感激。我正在使用 Akka 2.4.4 和 Play 2.5.3。
问题出在服务器端,它也是一个 Akka 应用程序。我已设置服务器连接超时并已解决问题。