I am reading an HTTP Response stream from a URL. The response runForeach
returns a stream of small chunks. I want to increase the chunk size.
I have an application.conf file where I experimented with the following
(increasing default values), but nothing changed. Wasn't sure which config
param is the one I need. I must be doing something wrong.
application.conf:
akka.http.host-connection-pool.client.parsing.max-chunk-size=50m
akka.http.host-connection-pool.client.parsing.max-chunk-ext-length=50m
akka.http.host-connection-pool.client.parsing.max-content-length=50m
my code:
var config: Config = ConfigFactory.load()
implicit val system = ActorSystem("test", config)import
system.dispatcherimplicit val materializer = ActorMaterializer()
val responseFuture: Future[HttpResponse] = Http().singleRequest(HttpRequest(uri
= source))
responseFuture.flatMap { response =>
val responseData = response.entity.dataBytes
responseData.runForeach(chunk => {
println(s"CHUNK:${chunk}")
})}
Thank you.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.