Q:

How to stream large HTTP response in spring

We have a HTTP request which when handled in server will create a response approximately 3GB in size, this data is an aggregation of 6 queries to database, how can we send this data as individual responses of 6 queries than as an aggregation.

A:

StreamingResponseBody is used for asynchronous request processing where the application can write directly to the response OutputStream.
Checkout this article
http://www.logicbig.com/how-to/code-snippets/jcode-spring-mvc-streamingresponsebody/
http://shazsterblog.blogspot.in/2016/02/asynchronous-streaming-request.html

