gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 23:23:48 29 4
gpt4 key购买 nike

我有一个内部调用 soap 网络服务的休息应用程序(基于 cxf)。我想将 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 集成的其余应用程序 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);

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

最佳答案

您必须添加以下代码:

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

您还要确保 /hystrix.stream 不安全。

关于java - 无法在 Hystrix 仪表板上查看 Hystrix 报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39629871/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com