While working on
SONAR-10060, a side effect of systematic streaming has been raised: as soon as the Servlet OutputStream is being written, it's no more possible to reset the response. If an exception is raised, it's no more possible to send a clean message.
Most of the web services rely on a wrapper Protobuf object to build the response. So, the streaming functionality is not used. Moreover, streaming is required for very few use cases: profile backup, batch issues and project export.
- by default, response.newJsonWriter() is not streamable. The response is writter when the JsonWriter resource is closed.
- to have a streamable response, the response.ouput().stream() must be used explicitly
- exception are logged in debug when the response has been partially streamed