Skip to content

request help: trigger a the postFitler method #308

@paologazzola

Description

@paologazzola

Issue description

Hello,
I wrote my first external plugin with this code:

public class ExamplePostFilter implements PluginFilter {

    @Override
    public String name() {
        return "ExamplePostFilter";
    }

    @Override
    public void postFilter(PostRequest request, PostResponse response, PluginFilterChain chain) {
        ... some logic ...
        chain.postFilter(request, response);
    }

}

Then I configured my route in this way:

  ...
  "ext-plugin-post-req": {
      "conf": [
        {
          "name": "ExamplePostFilter",
          "value": "{\n\"variable1\": \"testme\"\n}"
        }
      ]
    }

When I query the route, the postMethod(...) is never triggered (my breakpoints are ignored and no log is written). If I add in my plugin class some overrided methods like requiredRespBody(), I correctly see that they are triggered. I think that for some reasons (or some bad configuration), the doPostFilter(...) in the RpcCallHandles class is never reached.

What am I doing wrong with my plugin configuration?

Thanks a lot.
Paolo

Environment

Apisix 3.9.x
apisix-java-plugin-runner 0.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions