apache / apisix-go-plugin-runner

Go Plugin Runner for APISIX
https://apisix.apache.org/
Apache License 2.0
169 stars 69 forks source link

request help: does go runner support intercepting response to handle special business #51

Closed Easy-deve closed 1 year ago

Easy-deve commented 2 years ago

Does the go-runner plug-in support processing the information returned from upstream? If not, can you write an internal plug-in in Lua language to intercept the response to handle special business.

spacewander commented 2 years ago

Not support yet.

Easy-deve commented 2 years ago

Thanks for replying, I have another idea to be confirmed. I looked at the source code of apisix, and knew that I could get data from upstream in '_M.body_filter'. I want to write a own plug-in and call other services in '_M.body_filter' to perform some business processes. Is this feasible?

spacewander commented 2 years ago

It depends on whether you need to rewrite the body. Due to Nginx's limitation (you can't suspend the body handling), you can call other services via ngx.timer.at async, but you can't rewrite the body with the result.

soulbird commented 1 year ago

Already supported.