I use akka-http to make a request to the http service, which sends a response. Here's what the corresponding bit of code looks like:
val httpRequest: HttpRequest =
and the output from the command line looks something like this:
----- {"data": ----- "some text"} ----- {"data": ----- "this is a longer ----- text"} ----- {"data": "txt"} ----- ...
The logical part of the data - in this case, json ends with the end of line character \r\n , but the problem is that json does not always fit into one fragment of the HTTP response, as is clearly seen in the example above.
My question is: how to combine incoming data into full jsons so that the resulting container type still remains either Source[Out,M1] or Flow[In,Out,M2] ? I would like to follow the ideology of akka-stream .
UPDATE: It should also be noted that the answer is endless and aggregation should be done in real time
source share