我正在使用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/
时,我得到一个错误信息:Unable to connect to Command Metric Stream.' and WARN-log 'Origin parameter: http://localhost:8080/actuator/hystrix.stream is not in the allowed list of proxy host names. If it should be allowed add it to 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
额外的信息:
- 我在gateway-service的pom.xml中添加了
spring-boot-starter-actuator
。我还添加了spring-cloud-starter-circuitbreaker-reactor-resilience4j
。 - IntelliJ IDEA将
proxy-stream-allow-list'和
timeoutInMilliseconds’标记为*‘无法解决配置属性’*。
StackOverflow:How to solve 'Unable to connect to Command Metric Stream.' for Hystrix with Spring Boot 2.3.12 and Java 11? - Stack Overflow