Spring boot hystrix.stream、management.port和Spring Cloud涡轮机

Spring boot hystrix.stream、management.port和Spring Cloud涡轮机,spring-boot,spring-cloud,hystrix,turbine,spring-cloud-netflix,Spring Boot,Spring Cloud,Hystrix,Turbine,Spring Cloud Netflix,使用@EnableTurbine config的我的微服务: turbine: clusterNameExpression: new String('default') appConfig: bestallning bestallning是一个@SpringCloud应用程序,启用了hystrix.stream。它在eureka注册,turbine应用程序可以找到它。但它的management.port设置为8092,server.port设置为8082。hystrix.stream绑

使用@EnableTurbine config的我的微服务:

turbine:
  clusterNameExpression: new String('default')
  appConfig: bestallning
bestallning是一个@SpringCloud应用程序,启用了hystrix.stream。它在eureka注册,turbine应用程序可以找到它。但它的management.port设置为8092,server.port设置为8082。hystrix.stream绑定到management.port

Turbine现在尝试从bestallning的server.port获取hystrix.stream,而不是从hystrix.stream绑定到的management.port获取hystrix.stream

   Fetching instance list for apps: [bestallning]
   Fetching instances for app: bestallning
   Received instance list for app: bestallning, size=1
   Retrieved hosts from InstanceDiscovery: 1
   Found hosts that have been previously terminated: 0
   Hosts up:1, hosts down: 0
   Url for host: http://143.237.21.196:8082/hystrix.stream default
   Could not initiate connection to host, giving up: [{"timestamp":1460035761979,"status":404,"error":"Not Found","message":"No message available","path":"/hystrix.stream"}]
   Stopping InstanceMonitor for: 143.237.21.196 default

是否可以让turbine使用正确的端口查找hystrix.stream?

我认为您必须编写自己的
InstanceDiscovery
(并创建该类型的
@Bean
)。不过,在现有的实现中可能是一个有用的功能,因此请在Spring Cloud Netflix中打开一个问题。

我复制了一份
EurekaInstanceDiscovery
(因为eurekaClient和marshall是私有的:-p),并用@Component对其进行了注释。向每个application.yaml eureka实例元数据添加了
管理端口:${management.port}
,并在marshall中获取该元数据用作端口。。。似乎有效。将公开发行。。谢谢您可以设置一个属性
turbine.instanceUrlSuffix