We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
现在有这样一个需求, 我在A服务中调用B服务, 但是B服务要求每秒总请求不能超过60QPS, 例如,如下Feign客户端, 我应该怎么写才能实现对类中所有方法的总QPS进行限制 还有一种按分钟的, 每分钟不能超过2000QPS应该怎么实现
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; /** * 用户服务 * */ @FeignClient(contextId = "remoteUserService", value = "ruoyi-system") public interface RemoteUserService { @GetMapping(value = "/user/info/{username}") public Object getUserInfo(@PathVariable("username") String username); /** * 通过用户名查询用户信息 * * @param username 用户名 * @return 结果 */ @GetMapping(value = "/user/info/{userId}") public Object getUserInfo(@PathVariable("userId") Long userId); }
我尝试在接口上添加 @SentinelResource("remoteUserService") 然后再nacos中配置, 不起作用
[ { "resource": "remoteUserService", "count": 1, "grade": 1, "limitApp": "default", "strategy": 0, "controlBehavior": 0, "maxQueueingTimeMs": 2000 } ]
The text was updated successfully, but these errors were encountered:
注意使用dashboard对接看下自动生成的resourceName是什么,不是hystrix那套了,所以你这个配置根本不会生效
Sorry, something went wrong.
我比较好奇这个场景,按我的理解这种限流应该配置在B服务上,因为如果在客户端进行限制,A服务或者B服务扩容时都存在问题
No branches or pull requests
现在有这样一个需求, 我在A服务中调用B服务, 但是B服务要求每秒总请求不能超过60QPS,
例如,如下Feign客户端, 我应该怎么写才能实现对类中所有方法的总QPS进行限制
还有一种按分钟的, 每分钟不能超过2000QPS应该怎么实现
我尝试在接口上添加
@SentinelResource("remoteUserService")
然后再nacos中配置, 不起作用
The text was updated successfully, but these errors were encountered: