Closed liangyuanpeng closed 4 years ago
You may refer to the demo of SCA, https://github.com/alibaba/spring-cloud-alibaba/tree/master/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example
In com.alibaba.cloud.examples.TestController
:
@GetMapping("/slow")
public String slow() {
return circuitBreakerFactory.create("slow").run(() -> {
try {
Thread.sleep(500L);
}
catch (InterruptedException e) {
e.printStackTrace();
}
return "slow";
}, throwable -> "fallback");
}
It demonstrated how to use spring-cloud-circuitbreaker-sentinel
.
It's also easy to add some custom fallback, refer to: https://github.com/alibaba/Sentinel/wiki/主流框架的适配 https://github.com/alibaba/Sentinel/wiki/注解支持
It's also easy to add some custom fallback, refer to: https://github.com/alibaba/Sentinel/wiki/主流框架的适配 https://github.com/alibaba/Sentinel/wiki/注解支持
almost noone is able to read that
Did not solve my problem, for me the way of configuration file is the most ideal
Issue Description
Type: feature
Describe what happened (or what feature you want)
I hope I can simply use Sentinel in SpringCloud for circuitbreaker,some like :
I searched for a long time for the documentation and didn't find what I wanted.
I am so sad for it
What about
spring-cloud-circuitbreaker-sentinel
?I can not find anything for doc
Describe what you expected to happen
How to reproduce it (as minimally and precisely as possible)
Tell us your environment
Anything else we need to know?
Sentinel for SpringCloud Gateway