spring cloud hysrix断路器
Hysrix 断路器 首先引入依赖 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-hystrix</artifactId> </dependency> 修改application类并加入注解,当@EnableCircuitBreaker,@EnableEurekaClient,@SpringBootApplication三个注解同时存在时可以使用@SpringCloudApplication注解 加入注解,指定降级的方法 @HystrixCommand(fallbackMethod = "error") Hysrix仪表盘 引入依赖 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId> </dependency> 修改application类加入@EnableHystrixDashboard注解 接下来输入地址 http://localhost:8081/hystrix ,选择集群或则单体,设置时间和title,点击monitor