You can extend the HttpServer
and define your own timeout
trait CustomServer extends HttpServer with Tls {
then you overwrite the configureHttpServer
method and you define timeout, requests sites, and other attributes
override def configureHttpServer(server: Http.Server): Http.Server = {
server.withAdmissionControl.concurrencyLimit(maxConcurrentRequests = 2000, maxWaiters = 0)
.withResponseClassifier(HttpResponseClassifier.ServerErrorsAsFailures)
.withMaxRequestSize(StorageUnit.fromMegabytes(200))
.withRequestTimeout(50.seconds)
}
Or, a more minimal example in your class that extends Http.Server
:
override protected def configureHttpServer(server: Http.Server): Http.Server = {
super.configureHttpServer(server.withRequestTimeout(50.seconds))
}