apache / apisix-java-plugin-runner

APISIX Plugin Runner in Java
https://apisix.apache.org/
Apache License 2.0
128 stars 95 forks source link

bug: 在多线程环境下如何从filter传值到postFilter? 将filter中获取的数据和postFilter获取的数据串连起来 #248

Open forget99 opened 1 year ago

forget99 commented 1 year ago

Issue description

在多线程环境下,一个请求进入apisix网关,在路由上配置了ext-plugin-pre-req和ext-plugin-post-resp,在执行插件时,filter方法和postFilter执行顺序不是一一对应,导致数据错乱,如何将filter和postFilter通过一个唯一值串联起来呢

"plugins": { "ext-plugin-post-resp": { "allow_degradation": false, "conf": [ { "name": "AuthFilter", "value": "authFilter" } ], "disable": false }, "ext-plugin-pre-req": { "allow_degradation": false, "conf": [ { "name": "AuthFilter", "value": "authFilter" } ], "disable": false } },

can you help me?

gaoxingliang commented 11 months ago

@forget99 how about using the request.getRequestId() ?

gaoxingliang commented 9 months ago

I test the request id. it's not a tracking solution. and now I encountered the same problem .