Netflix / Turbine

SSE Stream Aggregator
Apache License 2.0
835 stars 255 forks source link

ConfigPropertyBasedDiscovery: support hostname with port #127

Open BarathArivazhagan opened 6 years ago

BarathArivazhagan commented 6 years ago

while building the list of instances for ConfigPropertyBasedDiscovery, is it possible to support port as part of hostname instead of reading ports from attributes property of Instance?

FROM

turbine:
  aggregator:
      clusterConfig: dev,test,prod
  instanceUrlSuffix: :9502/actuator/hystrix.stream
  ConfigPropertyBasedDiscovery:
    default: 
      instances: localhost 

To

turbine:
  aggregator:
      clusterConfig: dev,test,prod
  ConfigPropertyBasedDiscovery:
    default: 
      instances: localhost:9502,localhost:9503,localhost:9504

Tweaking below code might do the trick:

   String[] parts = instanceList.split(",");

        List<Instance> instances = new ArrayList<Instance>();
        for (String s : parts) {
            instances.add(new Instance(s, cluster, true));
        }

or else provide the users on how to set the port explicitly as part of property for ConfigPropertyBasedDiscovery rather than providing custom implementation of the discovery?