- /**
- * 热点流控 必须使用注解 @SentinelResource
- * @param id
- * @return
- */
- @RequestMapping("/getById/{id}")
- @SentinelResource(value = "getById", blockHandler = "hotParamHandler")
- public Object getById(@PathVariable("id") Integer id) {
- return "hi, order " + id;
- }
-
- /**
- * 热点参数流控处理器
- *
- * @param id
- * @param be
- * @return
- */
- public Object hotParamHandler(@PathVariable("id") Integer id, BlockException be){
- return id + " -> 热点流控了";
- }




