一、Hystrix 熔断器
1、引入pom
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-ribbon</artifactId>
</dependency>
<!--熔断器 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</ar

本文介绍了Spring Cloud Hystrix的熔断器机制,包括如何引入依赖,启用熔断器功能,以及在服务调用上使用@HystrixCommand进行异常处理。详细阐述了Hystrix的工作原理,当服务不可用时如何避免阻塞,通过配置超时时间、线程池限制以及提供监控来确保系统的稳定性和容错性。
最低0.47元/天 解锁文章
167万+

被折叠的 条评论
为什么被折叠?



