SpringCloud - hystrix fuse

What Hystrix do?

Service fuse, service degradation, limiting service, near real-time monitoring ...

Reference: https://github.com/Netflix/Hystrix/wiki/How-To-Use

Once the call to service method fails with an error message, it will automatically call the specified method invocation good fallbackMethod class @HystrixCommand marked.

dashboard monitor window:

7 colors, a circle, a line

Configuration

It is necessary to introduce the following monitoring terminal-dependent

<!-- 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>

Add the following comment:
@SpringBootApplication
@EnableDiscoveryClient // service discovery
@EnableCircuitBreaker

Necessary to introduce the following monitoring terminal-dependent

<!-- 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>

Add the following comment:
@SpringBootApplication
@EnableHystrixDashboard

Guess you like

Origin www.cnblogs.com/tangjian07/p/12167025.html