Open zirota opened 2 months ago
I found that the behaviour of the streaming response differs across different embedded servers.
The above behaviour comes from the default Tomcat server.
Jetty & Undertow buffers all chunked responses from the remote server and returns the entire response in full to the api caller.
However, can't seem to figure out how to disable or configure this buffer.
I have the same issue, use spring-cloud-gateway 4.0.7. The returned content does not exactly match the proxy's third-party interface, such as the proxy gemini interface
Hello,
I am using spring cloud gateway mvc: 4.1.5 When making requests that expects a streaming chunked response - where each chunk is returned to the api caller as soon as a chunk is ready. The gateway returns the response in different batches, each with multiple chunks at the same time.
I found a similar issue raised here: https://github.com/spring-cloud/spring-cloud-gateway/issues/2868
I don't think its that streaming is not supported as curl is return the response from the gateway in batches - instead of the entire response being returned all at once. It could be that the gateway is somehow caching the response chunks. Is there configuration that can be done on the gateway to resolve it?
Sample I have tried a variety of different approaches. Including the examples in the linked issue.
My original approach using just handler functions:
Attempt to use of StreamingResponseBody with ProxyExchange
Attempt to return a Flux<?> with ProxyExchange - I am not very familiar with the reactive way so pardon me if this seems incorrect: