Constructing Akka HTTP requests for JSON Lines

After a couple of years, I learnt that the blessed way with Akka http is to:

    val newline = ByteString("\n")

    implicit val jsonStreamingSupport: JsonEntityStreamingSupport = EntityStreamingSupport
      .json()
      .withFramingRenderer(Flow[ByteString].map(_ ++ newline))
2 Likes