Hi,
I'd like to deploy a sharedflow via flowhook that includes a java callout.
I have a few questions around streaming, these are the things I have already done:
- Got a working sharedflow that reads content and headers, applied via flowhook on all API Proxies.
- Googled, searched here in the apigee cloud forum for other questions and answers.
- Read documentation a few times.
The questions I have:
- I know we are not supposed to read message content when streaming is enabled, the docs clearly state that. BUT, since I'd basically like to access all transactions, on all API Proxies, I use a flowhook which applies to all API Proxies - Regardless of streaming.
And so, I do call message.getContent() - What is the outcome of this call on streaming API Proxies? Do I cause any harm? Do I cause any kind of buffering somewhere? Right now I am seeing empty body when streaming is enabled, which I understand is a limitation of Apigee and streaming APIs. - I understand that when the server responds with chunked-encoding, we can't know how many chunks are going to arrive until chunk-size 0, but what about just plain HTTP response with Content-Length header for a large file beyond 10MB? In that cause if streaming is enabled, why can't I read the content?
- Can we still run the Java Policy on streaming APIs if we avoid calling message.getContent()?
Will that make sure we are affecting behavior for the client and server? - How would we go about still using flowhooks, on all proxies, but not call message.getContent() for specific API Proxies that have streaming enabled?
- Can we potentially read the stream ourselves, run some logic for each chunk, like counting the length, and pass over the chunk to a new stream that will be fed down the chain that we interrupted?
- Is the behavior, limitations and practices similar to edge/x and hybrid?
One final request, can someone please elaborate a little, for clarity sake, about the implementation around streaming?
Thanks a lot and in advance!
Razor.