我有一个rest应用程序(基于cxf),它在内部调用soap服务。我想将hystrix集成到我的rest应用程序中。
1)使用现有的服务数据修改了下面的hystrix演示源代码,并部署了rest应用程序。
2)我下载了hystrix-dashboard war文件并部署到tomcat中,我可以看到hystrix仪表板主页。
现在,当我试图通过提供hystrix集成rest应用程序监视流时,将显示带有hystrix图标的url.Empty页面。当我查看控制台时,它显示了下面的错误
未定义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上。
发布于 2017-04-04 14:08:55
您必须添加以下代码:
@Bean
public ServletRegistrationBean servletRegistration() {
ServletRegistrationBean registration = new ServletRegistrationBean(new HystrixMetricsStreamServlet(), "/hystrix.stream");
return registration;
}您还需要确保/hystrix.stream不受保护。
https://stackoverflow.com/questions/39629871
复制相似问题