Dubbo 服务容错Hystrix

一、服务者

1.pom

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>
                spring-cloud-starter-netflix-hystrix
            </artifactId>
        </dependency>                    

2.启动类添加 @EnableHystrix   开启服务容错

3.方法出现异常 @HystrixCommand

二、消费者

1.pom

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>
                spring-cloud-starter-netflix-hystrix
            </artifactId>
        </dependency>                    

2.启动类添加 @EnableHystrix   开启服务容错

3.方法出现异常 @HystrixCommand

扫描二维码关注公众号,回复: 5779649 查看本文章

猜你喜欢

转载自www.cnblogs.com/mm163/p/10657142.html