HttpEntity has an apply method taking a ContentType and a Source[ByteString,Any] which returns a Chunked entity. Each element returned by the source is encoded as a chunk in the HTTP response.
This is not 'automatic' per se, but it exposes explicit control over chunking. - Arno Am 11.04.2016 um 19:44 schrieb Charlie Evans: > Hi all, > > I have an akka-http server which responds to certain requests with JSON > and sometimes the JSON can be very large (marshalled using > https://github.com/hseeberger/akka-http-json/tree/master/akka-http-json4s). > I get the impression the response is wrapped in a HttpEntity Strict so > can not be chunked/streamed back which may hurt the sender. Is there a > way to automatically chunk a request if it's beyond a certain number of > bytes? > > The data comes from an iterator so I could make that into a > Source[ByteString, NotUsed] using Source.fromIterator - would that be of > use? > > Thanks > > -- >>>>>>>>>>> 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] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. -- >>>>>>>>>> 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.
