Skip to content
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

route配置limit-count插件不起作用 #2908

Open
zhouwenqi opened this issue Jan 9, 2024 · 0 comments
Open

route配置limit-count插件不起作用 #2908

zhouwenqi opened this issue Jan 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@zhouwenqi
Copy link

Issue description

无论route是否配置插件,都走的global limit-count配置。route单独配置的根本不起作用

Expected behavior

这种基本现象都没法满足

当同一个插件在全局规则中和局部规则(例如路由)中同时配置时,两个插件将顺序执行。

然而,如果相同的插件在多个对象上本地配置,例如在[Route](https://apisix.apache.org/zh/docs/apisix/terminology/route/), [Service](https://apisix.apache.org/zh/docs/apisix/terminology/service/), [Consumer](https://apisix.apache.org/zh/docs/apisix/terminology/consumer/) 或[Plugin Config](https://apisix.apache.org/zh/docs/apisix/terminology/plugin-config/) 上,每个非全局插件只会执行一次,因为在执行期间,针对特定的优先顺序,这些对象中配置的插件会被合并:

Consumer > Consumer Group > Route > Plugin Config > Service

因此,如果相同的插件在不同的对象中具有不同的配置,则合并期间具有最高优先顺序的插件配置将被使用。

别外插件配置逻辑有问题吧,应该分3块隔离的吧:

  • 插件的启用关闭

  • 插件全局配置

  • 局部(路由/上游/消费者)插件配置

即便上面我的问题不出现,现在启用和全局配置放在一起搞,都没法单独关闭全局的。

How to Reproduce

  1. 在路由中添加一个路由并且配置limit-count插件,访问路由插件不生效;
  2. 在配置中启用配置limit-count插件,访问路由插件生效(但是走的全局配置);
  3. 重新添加一个路由并配置limit-count插件,仍然是上面的结果;

Screenshots

No response

Environment

  • apisix version : 3.7.0
  • OS version : centos 7
  • Nginx version : 1.19.0
  • etcd version : 3.4.15
  • apisix-dashboard version : 3.0.1
  • Browser version,: 114.0.5735.110

Additional context

No response

@zhouwenqi zhouwenqi added the bug Something isn't working label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant