How to check if streaming is enabled from a policy. The specific use case is that we have a policy which captures request and response bodies and can be attached as a Flowhook. According to apigee docs, these kinds of policies shouldn't be attached to streaming enabled proxies. In that case how can we check from a policy if streaming is enabled in the proxy or not?
Solved! Go to Solution.
I'm not aware of a flow variable that maintains streaming state/properties. If your flowhook is not in the preproxy, you could set a variable in your API proxy preflow, and then check for this in your flowhook.
Correction, while I don't see these in documentation.. Looks like you can use
proxy.request.streaming.enabled, proxy.response.streaming.enabled
For example, within a condition:
<Condition>proxy.request.streaming.enabled != true</Condition>
Streaming is configured in the proxy. If you're using streaming in the proxy, then dont use policies interacting with the payloads.
https://cloud.google.com/apigee/docs/api-platform/develop/enabling-streaming
yes, so if I add my policy as a flowhook, how can I skip those proxies where streaming is enabled?
I'm not aware of a flow variable that maintains streaming state/properties. If your flowhook is not in the preproxy, you could set a variable in your API proxy preflow, and then check for this in your flowhook.
Correction, while I don't see these in documentation.. Looks like you can use
proxy.request.streaming.enabled, proxy.response.streaming.enabled
For example, within a condition:
<Condition>proxy.request.streaming.enabled != true</Condition>
Thanks a lot, I verified this in Apigee X. Will this work in Apigee Edge also?
Yup! You verified in X, I verified in Edge.
Thanks a lot!