SpringCloud- 第五篇 Hystrix快速上手(二)
1:SpringCloud中使用: 1.1:加入依赖 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId> </dependency> 1.2:启动类上添加 @SpringBootApplication @EnableHystrixDashboard @EnableCircuitBreaker //@EnableHystrix 1.3:Controller上配置 在Controller的方法上添加Hystrix的配置,形如: @HystrixCommand(fallbackMethod = "error