首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法查看Hystrix仪表板上的Hystrix报告

无法查看Hystrix仪表板上的Hystrix报告
EN

Stack Overflow用户
提问于 2016-09-22 03:41:56
回答 1查看 751关注 0票数 0

我有一个rest应用程序(基于cxf),它在内部调用soap服务。我想将hystrix集成到我的rest应用程序中。

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

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

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

现在,当我试图通过提供hystrix集成rest应用程序监视流时,将显示带有hystrix图标的url.Empty页面。当我查看控制台时,它显示了下面的错误

未定义EventSource。

代码语言:javascript
复制
  //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上。

EN

回答 1

Stack Overflow用户

发布于 2017-04-04 14:08:55

您必须添加以下代码:

代码语言:javascript
复制
@Bean
public ServletRegistrationBean servletRegistration() {
  ServletRegistrationBean registration = new ServletRegistrationBean(new     HystrixMetricsStreamServlet(), "/hystrix.stream"); 
  return registration;
}

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39629871

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档