|
@@ -1,5 +1,6 @@
|
|
|
package anyi.space.memberServer.controller;
|
|
package anyi.space.memberServer.controller;
|
|
|
|
|
|
|
|
|
|
+import anyi.space.memberServer.components.MySentinelBlockHandler;
|
|
|
import com.alibaba.csp.sentinel.annotation.SentinelResource;
|
|
import com.alibaba.csp.sentinel.annotation.SentinelResource;
|
|
|
import com.alibaba.csp.sentinel.slots.block.BlockException;
|
|
import com.alibaba.csp.sentinel.slots.block.BlockException;
|
|
|
import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowException;
|
|
import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowException;
|
|
@@ -82,6 +83,14 @@ public class SentinelTestController {
|
|
|
return msg;
|
|
return msg;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @SentinelResource(value = "t6",blockHandlerClass = MySentinelBlockHandler.class,blockHandler = "myBlockHandler")
|
|
|
|
|
+ @GetMapping("/t6")
|
|
|
|
|
+ public String t6(){
|
|
|
|
|
+ String msg = "t6被执行";
|
|
|
|
|
+ System.out.println(msg);
|
|
|
|
|
+ return msg;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* news为测试Sentinel热点规则的接口
|
|
* news为测试Sentinel热点规则的接口
|
|
|
* @param id
|
|
* @param id
|