Open dyc87112 opened 6 years ago
有一点小坑,fallback的参数要和consumer保持一致
缺少一个依赖吧?关于@HystrixCommand
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-javanica</artifactId>
</dependency>
@HystrixCommand(fallbackMethod = "fallback") 始终走fallback 方法呢
要使用 @HystrixCommand 需要在上面依赖的基础上加上
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
少了一个注解 @Service
http://blog.didispace.com/spring-cloud-starter-dalston-4-1/
前言在微服务架构中,我们将系统拆分成了一个个的服务单元,各单元应用间通过服务注册与订阅的方式互相依赖。由于每个单元都在不同的进程中运行,依赖通过远程调用的方式执行,这样就有可能因为网络原因或是依赖服务自身问题出现调用故障或延迟,而这些问题会直接导致调用方的对外服务也出现延迟,若此时调用方的请求不断增加,最后就会出现因等