@SentinelResource热点名称随意,这里为abc,监控也监控bac,上面配置的是才懂第一个参数开始,qps>1就熔断
@GetMapping("/testHotKey")
@SentinelResource(value ="abc",blockHandler = "deal_testHotKey")//热键名称唯一
public String testHotKey(@RequestParam(value ="p1",required = false)String p1,
@RequestParam(value ="p2",required = false)String p2){
return "----testHotKey";
}
public String deal_testHotKey(String p1, String p2,BlockException blockException){
return "----deal_testHotKey,o(╥﹏╥)o";
}
依赖
com.alibaba.csp
sentinel-datasource-nacos
[
{
"resource": "/tateLimit/byUrl",
"limitApp": "default",
"grade": 1,
"count": 1,
"strategy": 0,
"controlBehavior": 0,
"clusterMode": false
}
]