[Akka HTTP] Respond with a partially streamed JSON object

18 views
Skip to first unread message

na...@bigpanda.io

unread,
Aug 17, 2017, 8:55:17 PM8/17/17
to Akka User List
I am trying to respond with a JSON object which has some strict values and some streamed values

```
{
  "total_results": 15,
  "items": [
    // Streamed JSON objects
  ]
}
```

Is there a way to respond like this without injecting the surrounding data into the Source?
I am currently using Play-Json that doesn't support this option natively

Konrad “ktoso” Malawski

unread,
Aug 17, 2017, 9:32:48 PM8/17/17
to akka...@googlegroups.com, na...@bigpanda.io
Nested streaming is somewhat tricky.

You could achieve the actual streaming semantics with injecting the things around it,
via something like `Source(the "header") concat streamingSource concat Source(“the ending ]]}]]}]”)`

We have tools coming for streaming nested parsing, but not rendering so far.

Konrad `kto.so` Malawski
--
>>>>>>>>>> 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 akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Nadav Mermer

unread,
Aug 20, 2017, 3:50:53 AM8/20/17
to Konrad “ktoso” Malawski, akka...@googlegroups.com
Thats what i did eventually, looking forward to see the tools you mentioned :)
Thanks!
Reply all
Reply to author
Forward
0 new messages