Unable to connect to Command Metric Stream. 连不上Hystrix监控

来源:10-7 hystrix-dashboard

菜鸟精髓

2018-06-09

我的控制台:

http://img.mukewang.com/szimg/5b1b790b0001c73813670282.jpg

我的版本:http://img.mukewang.com/szimg/5b1b79810001001f07020317.jpg

写回答

4回答

夏析

2018-06-19


@EnableFeignClients(basePackages = "com.sell.product.client")

@EnableHystrixDashboard
@SpringCloudApplication
@ComponentScan(basePackages = "com.sell")
public class OrderApplication {

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

   @Bean
   public ServletRegistrationBean getServlet(){
       HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
       ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
       registrationBean.setLoadOnStartup(1);
       registrationBean.addUrlMappings("/actuator/hystrix.stream");
       registrationBean.setName("HystrixMetricsStreamServlet");
       return registrationBean;
   }
}



加了一样没解决

0
2
精慕门5246777
解决了?
2020-01-17
共2条回复

菜鸟精髓

提问者

2018-06-11

boot 2.0.1 已解决:

@Bean
public ServletRegistrationBean getServlet() {
   HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
   ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
   registrationBean.setLoadOnStartup(1);
   registrationBean.addUrlMappings("/hystrix.stream");
   registrationBean.setName("HystrixMetricsStreamServlet");
   return registrationBean;
}

2
1
夏析
@EnableFeignClients(basePackages = "com.sell.product.client") @EnableHystrixDashboard @SpringCloudApplication @ComponentScan(basePackages = "com.sell") public class OrderApplication { public static void main(String[] args) { SpringApplication.run(OrderApplication.class, args); } @Bean public ServletRegistrationBean getServlet(){ HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet(); ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet); registrationBean.setLoadOnStartup(1); registrationBean.addUrlMappings("/actuator/hystrix.stream"); registrationBean.setName("HystrixMetricsStreamServlet"); return registrationBean; } } 加了一样没有解决
2018-06-19
共1条回复

老年新手

2020-08-25


@Bean
public ServletRegistrationBean getServlet(){
   HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
   ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
   registrationBean.setLoadOnStartup(1);
   registrationBean.addUrlMappings("/hystrix.stream");
   registrationBean.setName("hystrix.stream");
   return registrationBean;
}

0
0

菜鸟精髓

提问者

2018-06-09

没有老师演示的Application,怎么改???这个版本,跪求老师指导下

0
0

SpringCloud Finchley(M2+RELEASE+SR2)微服务实战

SpringCloud组件实现微服务,【已升级Finchley.Release】

5672 学习 · 2489 问题

查看课程