Reputation: 1
I am currently facing an issue with streaming responses in Kong Gateway. I have disabled response buffering at the route level, which successfully allows me to receive responses in a streamed manner , test and verified locally on my personal system. However, I also have a requirement to capture the request body and response details for logging purposes. To achieve this, I am using Kong functions in Pre-Plugins with the following settings: kong.log.set_serialize_value("request.body", kong.request.get_raw_body()) kong.log.set_serialize_value("response.body", kong.response.get_raw_body()) The problem arises when I use the kong pre plugin. The streamed response functionality is not working as expected on the above scenario. Instead of receiving the response in a streamed manner, the response appears to be buffered and send it to client, which is not the desired behavior.
I have gone through this link: https://docs.konghq.com/gateway/latest/plugin-development/pdk/kong.service.response/ to get the raw body from the service response, but I am still encountering issues with maintaining the streamed response. I would appreciate any guidance or solutions on how to maintain streamed responses while still capturing the request and response bodies using Pre-Plugins in Kong. Also do let me know if we have to create a custom plugin for the same
Thank you!
Upvotes: 0
Views: 267