如何解决如何解决“无法连接到命令指标流”对于带有 Spring Boot 2.3.12 和 Java 11 的 Hystrix?
我正在使用 Spring Boot 2.3.12、Java 11 和 Spring Cloud Hoxton.SR11 制作应用程序。我添加了 Eureka 和 Hystrix 服务。当我调用 'http://localhost:8080/actuator/hystrix.stream' 时,我会收到像 data: {"type": "ping"}
这样的消息流。
但是当我将此路径插入“http://localhost:9195/hystrix/”时,我收到一条错误消息“无法连接到命令指标流”。和 WARN-log 'Origin 参数:http://localhost:8080/actuator/hystrix.stream 不在允许的代理主机名列表中。如果允许将其添加到 hystrix.dashboard.proxyStreamAllowList'。
我将此添加到网关 properties.yaml:
management:
endpoints:
web:
exposure:
include: hystrix.stream,info,health
hystrix:
dashboard:
proxy-stream-allow-list: "*"
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 10000
附加信息:
- 我在网关服务的 pom.xml 中添加了
spring-boot-starter-actuator
。我还添加了spring-cloud-starter-circuitbreaker-reactor-resilience4j
。 - IntelliJ IDEA 将
proxy-stream-allow-list
和timeoutInMilliseconds
标记为'无法解析配置属性' - 这些链接没有帮助:Unable to connect to Command Metric Stream in hystrix dashboard、Unable to connect to Command Metric Stream for Hystrix Dashboard with Spring Cloud、Hystrix: Unable to connect to Command Metric Stream、Hystrix Dashboard Issue in Spring Boot、Unable to connect to Command Metric Stream. in Hystrix Dashboard issue。
更新 2:
我使用 Hystrix Dashboard 作为单独的新 Java 模块。该模块包含 application.properties:
server.port=9195
和主类:
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
@SpringBootApplication
@EnableHystrixDashboard
public class HystrixDashboardApplication {
public static void main(String[] args) {
SpringApplication.run(HystrixDashboardApplication.class,args);
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。