google-cloud-platformgoogle-cloud-run

Does Google Cloud Run support streaming response data?


I just deployed my application to Google Cloud Run. It has an HTTP end-point that returns a streaming response, so the client can start rendering data as it comes in instead of waiting for the response to complete (which takes ~ 10 seconds).

The response has a content-type header application/stream+json, and the data is written to the response as separate lines. I have had this app deployed elsewhere over HTTPS and the streaming worked just fine there.

However, when deployed on Google Cloud Run the client doesn't receive any data until the response has completed.

Is this a limitation of Google Cloud Run, or is there a way I can fix this?


Solution

  • For "managed" Cloud Run, no. From https://cloud.google.com/run/docs/issues:

    Cloud Run (fully managed) currently does not support HTTP streaming.

    However Cloud Run on GKE does support streaming response data.