Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-10154

No streaming of web services response by default

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0
    • Component/s: Web API
    • Labels:
      None

      Description

      Context

      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.

      Solution

      • 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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              teryk.bellahsene Teryk Bellahsene
              Reporter:
              teryk.bellahsene Teryk Bellahsene
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: