Turbine without EurekaDiscovery
I'm trying to use spring-cloud-starter-turbine but with a different Discovery (ConfigPropertyBasedDiscovery) but it always use Eureka. Is it possible to use ConfigPropertyBased, FileBasedDiscovery or a CustomBasedDiscovery? Or only with Eureka?
application.yml
turbine:
aggregator:
clusterConfig: FOO
clusterNameExpression: 'default'
appConfig: foo
instanceUrlSuffix: :9002/hystrix.stream
ConfigPropertyBasedDiscovery.default.instances: localhost
server:
port: 8989
You should be able to create a bean of type InstanceDiscovery. see https://github.com/spring-cloud/spring-cloud-netflix/blob/master/spring-cloud-netflix-turbine/src/main/java/org/springframework/cloud/netflix/turbine/TurbineHttpConfiguration.java#L62-L83
Thank you very much. Worked fine.
Can someone provide a sample? I am providing my own implementation but the TurbineHttpConfiguration is loaded before my beans are created so I can't override what it uses.
My problem was that the turbine documentation says to set the implementation in a config property but this doesn't work. You simple have to create a bean of whatever implementation you want to use like so:
@Bean
public FileBasedInstanceDiscovery myInstance() {
return new FileBasedInstanceDiscovery();
}
Just make sure it is in a @Configuration class. At first I just added to my SpringBootApplication class but this doesn't work.