From Akka-HTTP docs (http://doc.akka.io/docs/akka-http/current/scala/http/client-side/connection-level.html#timeouts)
Currently Akka HTTP doesn’t implement client-side request timeout
checking itself as this functionality can be regarded as a more
general purpose streaming infrastructure feature.
It should be noted that Akka Streams provide various timeout
functionality so any API that uses streams can benefit from the stream
stages such as idleTimeout, backpressureTimeout, completionTimeout,
initialTimeout and throttle. To learn more about these refer to their
documentation in Akka Streams (and Scala Doc).
Essentially the choice is left to the user to add timeout control to their client-side stream. For instance, in the example shown in the docs you could add a completionTimeout
stage to achieve this
val responseFuture: Future[HttpResponse] =
Source.single(HttpRequest(uri = "/"))
.via(connectionFlow)
.completionTimeout(5.seconds)
.runWith(Sink.head)
And note that if you're after infinite
timeout (as per your Spray config), that will come for free by not adding any timeout stage.