java - 如何解决“无法连接到命令度量流”。对于带有 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
附加信息:
- 我添加
spring-boot-starter-actuator
到网关服务的 pom.xml 中。我还添加了spring-cloud-starter-circuitbreaker-reactor-resilience4j
. - IntelliJ IDEA 标记
proxy-stream-allow-list
为timeoutInMilliseconds
“无法解析配置属性” - 这些链接没有帮助:无法连接到 hystrix 仪表板中的命令度量流,无法使用 Spring Cloud连接到 Hystrix 仪表板的命令度量流,Hystrix:无法连接到命令度量流,Spring Boot 中的 Hystrix 仪表板问题,无法连接到命令度量流。在 Hystrix Dashboard 问题中。
更新 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);
}
}
解决方案
推荐阅读
- elasticsearch - 为什么频繁写入后elasticsearch索引性能下降
- ios - 为什么 NSUserDefaults 备份到 iCloud 但不通过所有设备同步?
- c# - 如何获取通过引用传递的变量名字符串?
- reactjs - 从 useEffect 访问上下文
- apama - 来自 Cumulocity 中内置 Apama 运行时的 HTTP 请求
- c++ - 运行代码时访问冲突写入位置0x00000079
- java - Intellij-idea 类导入
- java - 使用特定区域设置/国家/地区的可读类型格式化日期
- html - 锚点在不同页面上的行为不同
- java - 基于查询参数动态改变Zuul中路由的url