我正在使用ConfigPropertyBasedDiscovery配置hystrix turbine dashbord。当我点击普通流URL时,它工作正常 http://localhost:8080/turbine.stream?cluster=EXAMPLE
但是当我尝试在dashbord中加载此群集流时,它会显示以下错误"无法连接命令矩阵"在浏览器和控制台上" EventSource的响应具有MIME类型(" text / plain"),而不是" text / event-stream"。中止连接。"。请看一下屏幕截图。
以下是我的config.properties
turbine.aggregator.clusterConfig=EXAMPLE,EXAMPLE1
turbine.instanceUrlSuffix=:9080/hystrix.stream
turbine.ConfigPropertyBasedDiscovery.EXAMPLE.instances=localhost
turbine.ConfigPropertyBasedDiscovery.EXAMPLE1.instances=139.126.244.170
InstanceDiscovery.impl=com.netflix.turbine.discovery.ConfigPropertyBasedDiscovery
我的Application.java
@EnableHystrixDashboard
public class Application extends SpringBootApplication {
private static Class<Application> applicationClass = Application.class;
public static void main(String[] args) {
SpringApplication.run(applicationClass, args);
TurbineInit.init();
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
super.configure(application);
return application.sources(applicationClass);
}
}
And servlet registration for "/turbine.stream"
@Configuration
public class ServletRegistrationConfig {
@Bean
public ServletRegistrationBean registerTurbineBean(){
return new ServletRegistrationBean(new TurbineStreamServlet(), "/turbine.stream");
}
}
请帮助我。如果我错过了配置,请告诉我。