Apigee Streaming config

Per Apigee document, we need to enable the streaming for both proxyEndpoint and TargetEndpoit. It seems we should always enable both to get it work. However, it seems to be working when only enabled at TargetEndpoint(not enabled at proxyEndpoint). Is this behavior expected? Is a good way to verify streaming is enabled or disabled at runtime?

0 3 605
3 REPLIES 3

@dwc, as you have already identified on Apigee Edge, streaming can be enabled at two ends; Firstly, between client applications and API proxies, either on the request flow, response flow or on both. Secondly, between Apigee and the Target Endpoints, either on the request flow, response flow or on both.

It is not a must to enable streaming on both ends. Streaming on each end might need to be enabled based on the requirement. If streaming is only enabled at the API proxy, it will only stream data between client applications and Apigee. The same applies to Target Endpoints.

It is important to note that once streaming is enabled on either end, it might not be possible to read and process the message body using API proxy policies in each message flow (request flow/response flow).

How to Enable Streaming between Client Applications and API Proxies:

<ProxyEndpoint name="default"> 
   <HTTPProxyConnection> 
   <URL>http://target-host/target/endpoint</URL> 
   <Properties> 
      <Property name="response.streaming.enabled">true</Property> 
      <Property name="request.streaming.enabled">true</Property> 
   </Properties> 
   </HTTPProxyConnection>
</ProxyEndpoint> 

How to Enable Streaming between Apigee and Target Endpoint:

<TargetEndpoint name="default">
   <HTTPTargetConnection>
      <URL>http://target-host/target/endpoint</URL>
      <Properties>
         <Property name="response.streaming.enabled">true</Property>
         <Property name="request.streaming.enabled">true</Property>
      </Properties>
   </HTTPTargetConnection>
</TargetEndpoint> 

More information on this can be found at below URLs:

https://docs.apigee.com/api-platform/develop/enabling-streaming https://community.apigee.com/articles/61602/how-to-conditionally-enable-streaming-in-apigee.html

@Imesh Gunaratne, Thanks for the reply. what are the use cases requires streaming enabled at the proxy endpoint? My understanding is that the streaming is to avoid writing the request/response into the buffer. if streaming is enabled at target endpoint due to large response, most likely the proxy endpoint response streaming should be also enabled. In my case, it doesn't seem the proxy endpoint streaming is required when the target endpoint streaming is enabled which is confusing me. My proxy is just a pass-through, simply need streaming because response contains large documents.

@dwc: Thanks for your feedback. Yes, I think your understanding is correct. As API proxies could be implemented in different ways;

1. Client -> API Proxy -> Target Endpoint

2. Client -> API Proxy -> Node.js Hosted Target

3. Client -> API Proxy (No Target Endpoint)

4. Client -> API Proxy (Java Callout Policy -> Target Endpoint)

5. Client -> API Proxy (JavaScript Policy -> Target Endpoint)

Apigee Edge has been designed to enable streaming separately at Proxy Endpoint and Target Endpoint. In this specific scenario (1) if streaming is enabled at the Target Endpoint, it would be better to enable streaming at the Proxy Endpoint to optimize performance of the API proxy and the API gateway runtime.

In other scenarios, depending on the API proxy implementation we may only need to enable streaming at the Proxy Endpoint which may not use the Target Endpoint configuration.