How to set maximum content length using akka client client?

If I try to download a very large file (over 100 MB), I get this error:

 You can configure this by setting `akka.http.[server|client].parsing.max-content-length` or calling `HttpEntity.withSizeLimit` before materializing the dataBytes stream.


val responseFuture: Future[HttpResponse] =
  Http().singleRequest(HttpRequest(uri = "http://akka.io"))

I read that I can somehow set HttpEntity to withoutSizeLimit, how can I do this?

By the way, if I add these configuration settings to my application.config, this will not solve the problem:

akka.http.server.parsing.max-content-length=913753229
akka.http.client.parsing.max-content-length=913753229
+4
source share
1 answer

I noticed comments on the source code of the method withSizeLimit(maxBytes: Long)in akka.http.scaladsl.model.HttpEntity:

, , , - , Source, , HttpEntity.limitable. , HTTP, , , , , HttpEntity.limitable .

, Source limitableByteSource(), HttpEntity, withoutSizeLimit . : akka http doc.

, , withSizeLimit() . , : -)

0

Source: https://habr.com/ru/post/1653221/


All Articles