object777 opened a new issue, #152:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/152
### Issue description
2022/06/21 11:42:33 [error] 47#47: *56450 [lua] init.lua:617: phase_func():
failed to handle RPC_EXTRA_INFO: unsupported info type: 2, client: 172.24.0.1,
server: _, request: "GET /v2/vue/api/programLanguage/getAll HTTP/1.1", host:
"10.66.68.141:4080"
2022/06/21 11:42:33 [warn] 47#47: *56450 [lua] plugin.lua:680: run_plugin():
ext-plugin-pre-req exits with http status code 503, client: 172.24.0.1, server:
_, request: "GET /v2/vue/api/programLanguage/getAll HTTP/1.1", host:
"10.66.68.141:4080"
### Environment
@Component
public class FooFilter implements PluginFilter {
private final Logger logger = LoggerFactory.getLogger(FooFilter.class);
@Override
public String name() {
return "FooFilter";
}
@Override
public void filter(HttpRequest request, HttpResponse response,
PluginFilterChain chain) {
// get conf of current filter
String configStr = request.getConfig(this);
Gson gson = new Gson();
Map<String, Object> conf = new HashMap<>();
// convert according to the actual configured conf type
conf = gson.fromJson(configStr, conf.getClass());
// get extra info
String remoteAddr = request.getVars("remote_addr");
String serverPort = request.getVars("server_port");
String body = request.getBody();
chain.filter(request, response);
}
@Override
public List<String> requiredVars() {
List<String> vars = new ArrayList<>();
vars.add("remote_addr");
vars.add("server_port");
return vars;
}
@Override
public Boolean requiredBody() {
return true;
}
}
* your apisix-java-plugin-runner version
release/0.2.0
--
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]