Behavior of response.content when response streaming is enabled

Hello,

I understand the content of the message or payload is not available when streaming is enabled. However, what is the expected behavior of using response.content for example in say a JS policy? Should an error/exception be raised/thrown or should the value simply be undefined/null.

Thanks,
Steve

Solved Solved
0 2 233
1 ACCEPTED SOLUTION

It is an anti-pattern, when you try to access oayload while streaming,

  • Streaming will be disabled which can lead to increased latencies in processing the data
  • Increase in the heap memory usage or OutOfMemory Errors can be observed on Message Processors due to use of in-memory buffers especially if we have large request/response payloads

https://docs.apigee.com/api-platform/antipatterns/payload-with-streaming

View solution in original post

2 REPLIES 2

It is an anti-pattern, when you try to access oayload while streaming,

  • Streaming will be disabled which can lead to increased latencies in processing the data
  • Increase in the heap memory usage or OutOfMemory Errors can be observed on Message Processors due to use of in-memory buffers especially if we have large request/response payloads

https://docs.apigee.com/api-platform/antipatterns/payload-with-streaming

Thanks for your response and reference to the antipattern.