Hystrix 的使用
- 引入maven依赖
<!--hystrix 依赖开始-->
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-core</artifactId>
<version>1.5.18</version>
</dependency>
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-metrics-event-stream</artifactId>
<version>1.5.18</version>
</dependency>
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-javanica</artifactId>
<version>1.5.18</version>
</dependency>
<!--hystrix 依赖结束-->
- 使用Hystrix 监控接口数据
@HystrixCommand(commandKey = "nlpHys",threadPoolKey = "nlpHysPool",fallbackMethod = "nlpHysFb",
commandProperties = {
@HystrixProperty(name = "execution.isolation.strategy", value = "THREAD"),