Circuit Breaker: Hystrix Dashboard (断路器:hystrix 仪表盘)

基于service-ribbon 改造下:

pom.xml加入:

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

在主程序入口中加入@EnableHystrixDashboard注解,开启hystrixDashboard:

@SpringBootApplication
@EnableDiscoveryClient
@EnableCircuitBreaker
@EnableHystrixDashboard
public class ServiceRibbonApplication {

    public static void main(String[] args) {
        SpringApplication.run(ServiceRibbonApplication.class, args);
    }

    @Bean
    @LoadBalanced
    RestTemplate restTemplate() {
        return new RestTemplate();
    }

}

打开浏览器:访问http://localhost:8764/hystrix,界面如下:

ribbon hystrix仪表盘

点击monitor stream,进入下一个界面,访问:http://localhost:8764/hi?name=forezp访问ribbon负载一个请求

此时会出现监控界面:

ribbon hystrix仪表盘

相关文章:

  • 2021-05-15
  • 2021-09-09
  • 2021-08-30
  • 2021-09-08
  • 2021-12-10
  • 2021-12-25
  • 2021-12-08
猜你喜欢
  • 2022-12-23
  • 2022-01-04
  • 2021-12-17
  • 2021-06-02
  • 2021-07-24
  • 2021-07-04
  • 2021-08-27
相关资源
相似解决方案