dubbo“雪崩效应”解决方案 --Hystrix 熔断
·
提供者pox.xml加入
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
在application启动类中加入注解@EnableHystrix,启动
在@Service类中的每个方法加注解@HystrixCommand
@HystrixCommand(fallbackMethod = "err")
fallbackMethod 表示当前方法熔断了,则跳转到err方法
更多推荐
所有评论(0)