## 加依赖 ``` <!--alibaba sentinel--> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId> </dependency> ``` ## 加配置 ![](https://img.kancloud.cn/d1/88/d1883e4443bbafc9548e2d90bf665666_1358x423.png) ![](https://img.kancloud.cn/aa/c3/aac30276fa2eaac7e1e9c31f6b11e726_1919x544.png) ## 加资源名称 ![](https://img.kancloud.cn/50/c2/50c2f26cbcd1ba8c48eba6ff7effcef9_1600x597.png) ![](https://img.kancloud.cn/cb/57/cb57fb8ef499bdb8169cb4fbf3457c83_1920x873.png) ## 根据资源设置热点规则 ![](https://img.kancloud.cn/07/a4/07a4e7e9ce37c389922d36dcb191378a_1570x456.png) ## 测试流控api ### 正常结果 ![](https://img.kancloud.cn/43/88/43888e361f1a7c89cba9c2ecd18b0f40_1920x491.png) ### 异常结果 ![](https://img.kancloud.cn/c5/32/c532e3ef2420ba9fe489fe9d75dd946e_1907x574.png) ## 查看sentinel-dashboard 对于产品id=1的进行热点数据流控 ![](https://img.kancloud.cn/49/d2/49d26766127cfe23869a8925f58c2a33_1920x552.png)