Does apigee supports api streaming and convert rest to stream?

Few REST apis for the bank which means they are secured by oauth and session based.

Need is to convert those rest API to stream and restrict the access with the access token, which means once access token expires, the stream should stop. Open streams to browser-based session and limit the usage to a single customer simultaneously do it for other customers. Is there a recommended pattern for this sort of usage?

1 1 304
1 REPLY 1

Bharat, you can enable streaming for target endpoints when creating API proxies in Apigee by setting request.streaming.enabled=true and/or response.streaming.enabled=true as required as shown in the following configuration:

<TargetEndpoint name="default">
  <HTTPTargetConnection>
    <URL>http://mocktarget.apigee.net</URL>
    <Properties>
      <Property name="response.streaming.enabled">true</Property>
      <Property name="request.streaming.enabled">true</Property>
      <Property name="supports.http10">true</Property>
      <Property name="request.retain.headers">User-Agent,Referer,Accept-Language</Property>
      <Property name="retain.queryparams">apikey</Property>
    </Properties>
  </HTTPTargetConnection>
</TargetEndpoint><br>

This will expose the API in Apigee as a standard REST API and the message processors will talk to the backend endpoint by enabling streaming. AFAIK, streaming may not stop even if the access token expires while data is being transferred as the token validation is done before the streaming is started. You can find more information on this at [1].

[1] https://docs.apigee.com/api-platform/develop/enabling-streaming