Aop结合Guava实现的接口的限流保护(单机版)
@RestController
public class GuavaRate {
@ZRateLimiter(rate = 5,timeOut = 100)
@RequestMapping("/find2")
public void tryAcquire(){
}
}
@Target(value = ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ZR
原创
2021-02-24 09:53:12 ·
148 阅读 ·
0 评论