首页 文章

无法在Hystrix仪表板上查看Hystrix报告

提问于
浏览
0

我有一个休息应用程序(基于cxf),内部调用soap Web服务 . 我想将hystrix集成到我的休息应用程序中 .

1)使用我们现有的服务数据修改了下面的hystrix演示源代码,并部署了其余的应用程序 .

https://github.com/Netflix/Hystrix/tree/master/hystrix-examples/src/main/java/com/netflix/hystrix/examples/demo

2)我下载了 hystrix-dashboard war文件并部署到tomcat中,我可以看到hystrix仪表板主页 .

现在,当我试图通过提供hystrix集成的休息应用程序来监视流时,将显示带有hystrix图标的url.Empty页面 . 当我看IE开发者控制台时,它显示以下错误

EventSource is not defined.

//code snippet from ie developer console
  var proxyStream = "../proxy.stream?origin=http://localhost:8080/hystrix/hystrix.stream;
  // start the EventSource which will open a streaming connection to the server
  var source = new EventSource(proxyStream);

注意:两者都部署在同一台机器上 - localhost

1 回答

  • 0

    你必须添加以下代码:

    @Bean
    public ServletRegistrationBean servletRegistration() {
      ServletRegistrationBean registration = new ServletRegistrationBean(new     HystrixMetricsStreamServlet(), "/hystrix.stream"); 
      return registration;
    }
    

    您还要确保 /hystrix.stream 不受保护 .

相关问题