public class EurekaInstanceDiscovery extends Object implements com.netflix.turbine.discovery.InstanceDiscovery
InstanceDiscovery
implementation that uses Eureka (see https://github.com/Netflix/eureka) The plugin
requires a list of applications configured. It then queries the set of instances for
each application. Instance information retrieved from Eureka must be translated to
something that Turbine can understand i.e the
Instance
class.
All the logic to perform this translation can be overriden here, so that you can provide your own implementation if needed.
Constructor and Description |
---|
EurekaInstanceDiscovery(TurbineProperties turbineProperties,
com.netflix.discovery.EurekaClient eurekaClient) |
Modifier and Type | Method and Description |
---|---|
protected String |
getClusterName(com.netflix.appinfo.InstanceInfo iInfo)
Helper that fetches the cluster name.
|
Collection<com.netflix.turbine.discovery.Instance> |
getInstanceList()
Method that queries Eureka service for a list of configured application names
|
protected com.netflix.turbine.discovery.Instance |
marshallInstanceInfo(com.netflix.appinfo.InstanceInfo instanceInfo)
Private helper that marshals the information from each instance into something that
Turbine can understand.
|
protected Boolean |
parseInstanceStatus(com.netflix.appinfo.InstanceInfo.InstanceStatus status)
Helper that returns whether the instance is Up of Down
|
public EurekaInstanceDiscovery(TurbineProperties turbineProperties, com.netflix.discovery.EurekaClient eurekaClient)
public Collection<com.netflix.turbine.discovery.Instance> getInstanceList() throws Exception
getInstanceList
in interface com.netflix.turbine.discovery.InstanceDiscovery
Exception
protected com.netflix.turbine.discovery.Instance marshallInstanceInfo(com.netflix.appinfo.InstanceInfo instanceInfo)
instanceInfo
- protected Boolean parseInstanceStatus(com.netflix.appinfo.InstanceInfo.InstanceStatus status)
protected String getClusterName(com.netflix.appinfo.InstanceInfo iInfo)
Copyright © 2015 Pivotal Software, Inc.. All rights reserved.