限流特性不能正常使用
jimchou800 opened this issue · comments
jboot版本1.4.4
场景一:
1、已配置 jboot.limitation.webPath = /jboot/limitation
2、Action上加@EnableConcurrencyLimit (rate = 2)注解
3、访问/jboot/limitation 返回数据:{"ipRates":{},"userRates":{},"concurrencyRates":{},"requestRates":{}}
4、并发访问action 没有限流效果
场景二:
1、通过/jboot/limitation/set 设置action限流
2、访问 /jboot/limitation 返回数据: {"ipRates":{},"userRates":{},"concurrencyRates":{"/user":{"enable":true,"rate":2.0,"type":"concurrency"}},"requestRates":{}}
3、并发访问action 有限流效果
JbootLimitationManager.java
if (excludedMethodName.contains(method.getName()) || method.getParameterTypes().length != 0) {
continue;
}
method.getParameterTypes().length != 0 有参数的action 直接跳过?
可能是你第二个描述导致的第一个问题,之前没考虑过java8版本的带参数的action,是不是你的/user 这个 action是带有参数的方法呢?
是的,这个action方法带参数
最新版本已经修复