spring-cloud/spring-cloud-netflix,设置hystrix origin id

spring-cloud/spring-cloud-netflix, setting the hystrix origin id

我正在使用 spring-cloud-samples/customer-stores 示例并使其按照描述工作(特别是使用 1.1.0-BUILD-SNAPSHOT)

似乎当事物流向 hystrix 时,它附加了一个原始对象,如下所示:

"origin": {
  "host": "192.168.60.100",
  "port": 9000,
  "serviceId": "customers",
  "id": "customers:mysql:9000"
}

具体来说,看起来 "id" 是从 serviceId:spring.profiles.active:server.port

创建的

当你有几个不同的组合可以使用时,这很好用,但是,当我 运行 多个服务在不同的 ip 上具有相同的 server.port 或 运行 几个 docker 具有相同 server.port 的容器,涡轮聚合变得乱码并且没有意义,因为数据正在自己写入。

我想知道 Spring 中是否有特定的方法可以在我们的设置中专门影响该 id 的值。

只需按照@spencergibb 在 github 中的 post 中所述设置 hystrix.stream.queue.send-id=falsehttps://github.com/spring-cloud/spring-cloud-netflix/issues/740 即可解决问题。