yangfuhai / jboot

一个优雅的微服务框架,SpringCloud 之外的另一个选择,已经使用在用户量过亿的商业产品上,有超过1000家公司在使用Jboot做极速开发...
http://www.jboot.com.cn
Apache License 2.0
732 stars 252 forks source link

限流特性不能正常使用 #48

Closed jimchou800 closed 6 years ago

jimchou800 commented 6 years ago

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 有限流效果

jimchou800 commented 6 years ago

JbootLimitationManager.java

if (excludedMethodName.contains(method.getName()) || method.getParameterTypes().length != 0) { continue; } method.getParameterTypes().length != 0 有参数的action 直接跳过?

yangfuhai commented 6 years ago

可能是你第二个描述导致的第一个问题,之前没考虑过java8版本的带参数的action,是不是你的/user 这个 action是带有参数的方法呢?

@jimchou800

jimchou800 commented 6 years ago

是的,这个action方法带参数

yangfuhai commented 6 years ago

最新版本已经修复