标签:group frame discovery dashboard over href uri star pre
服务熔断、服务降级、服务限流、接近实时的监控...
参考:https://github.com/Netflix/Hystrix/wiki/How-To-Use
一旦调用服务方法失败并抛出了错误信息后,会自动调用 @HystrixCommand 标注好的 fallbackMethod 调用类中的指定方法。
7色,1圈,1线
被监控端需要引入以下依赖
<!-- actuator监控信息完善 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- hystrix -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
加以下注解:
@SpringBootApplication
@EnableDiscoveryClient //服务发现
@EnableCircuitBreaker
监控端需要引入以下依赖
<!-- hystrix和 hystrix-dashboard相关-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency>
加以下注解:
@SpringBootApplication
@EnableHystrixDashboard
标签:group frame discovery dashboard over href uri star pre
原文地址:https://www.cnblogs.com/tangjian07/p/12167025.html