FirstCatchYourHare opened a new issue, #11356:
URL: https://github.com/apache/apisix/issues/11356
### Current Behavior
When I turn on kafka-logger and body-transformer at the same time, the
response body conversion of body-transformer plugin will fail. After turning
off kafka-logger, body-transformer plug-in will fail
### Expected Behavior
I hope that when I turn on kafka-logger and body-transformer at the same
time, both will work properly at the same time
### Error Logs
When I turn on kafka-logger and body-transformer at the same time,By
tracking the source code log,I found that when the body-transformer plugin
code went to body_filter, it got an empty response table, so the conversion
failed, but the request was still successful, but no response body was returned
function _M.body_filter(_, ctx)
local conf = ctx.body_transformer_conf
if conf.response then
local body = core.response.hold_body_chunk(ctx)
core.log.error(cjson.encode(body))
if ngx.arg[2] == false and not body then
return
end
local out = transform(conf, body, "response", ctx)
if not out then
core.log.error("failed to transform response body: ", body)
return
end
ngx.arg[1] = out
end
end
### Steps to Reproduce
1.Enable plug-ins kafka-logger and body-transformer at the same time
2.The upstream service is a webservice
3.By configuring body-transformer, you mainly convert the xml response body
to the json response body
### Environment
- APISIX version (run `apisix version`):apache/apisix-3.2.0-debian
- Operating system (run `uname -a`):Linux new 3.10.0-1127.el7.x86_64 #1 SMP
Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):nginx
version: openresty/1.21.4.1
- etcd version, if relevant (run `curl
http://127.0.0.1:9090/v1/server_info`):3.5.0
- APISIX Dashboard version, if relevant:apache/apisix-dashboard
3.0.0-alpine
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run `luarocks --version`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]