用sentinel实现接口QPS限制
1、引入pom依赖
<dependencyManagement> <dependencies> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-dependencies</artifactId> <version>2021.0.4.0</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
<!--流量控制,熔断降级,系统负载保护--> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId> </dependency>
2、编写接口,接口打上sentinel 注解
3、设置Sentinel QPS限流参数
public class SentinelUtil { pu