Skip to content

request help: trigger a the postFitler method #308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
paologazzola opened this issue Jun 26, 2024 · 1 comment
Closed

request help: trigger a the postFitler method #308

paologazzola opened this issue Jun 26, 2024 · 1 comment

Comments

@paologazzola
Copy link

paologazzola commented Jun 26, 2024

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

@paologazzola
Copy link
Author

My fault, i have to use ext-plugin-post-resp instead of ext-plugin-post-req.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant