2016-09-22 73 views
0

我有一个内部调用soap web服务的休息应用程序(基于cxf)。我想将hystrix整合到我的其他应用程序中。无法在Hystrix仪表板上查看Hystrix报告

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

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

2)我下载椎的仪表板 war文件并部署到Tomcat和我可以看到仪表盘椎主页。

现在,当我试图通过提供hystrix集成休息应用程序URL来监视流。与hystrix图标的空页面正在显示。当我查看IE开发者控制台时,显示如下错误

EventSource未定义。

//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); 

注:两者都部署同一台机器上 - 本地主机

+0

你可以尝试使用其他浏览器(例如Firefox或Chrome)的相同功能吗? – Nicholas

回答

0

你必须添加以下代码:

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

也确保了/hystrix.stream没有固定。