1 引入依赖
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-hystrix</artifactId> </dependency>
2 使用注解
@HystrixCommand(fallbackMethod = "defaultDataServer")
3 实现回调的方法
private String dafaultDataServer(){ return "data server is down!"; }