Interface LookupService<T>

  • Type Parameters:
    T - for backward compatibility
    All Known Subinterfaces:
    EurekaClient
    All Known Implementing Classes:
    DiscoveryClient

    public interface LookupService<T>
    Lookup service for finding active instances.
    • Method Detail

      • getApplication

        Application getApplication​(java.lang.String appName)
        Returns the corresponding Application object which is basically a container of all registered appName InstanceInfos.
        Parameters:
        appName -
        Returns:
        a Application or null if we couldn't locate any app of the requested appName
      • getInstancesById

        java.util.List<InstanceInfo> getInstancesById​(java.lang.String id)
        Returns the List of InstanceInfos matching the the passed in id. A single InstanceInfo can possibly be registered w/ more than one Applications
        Parameters:
        id -
        Returns:
        List of InstanceInfos or Collections.emptyList()
      • getNextServerFromEureka

        InstanceInfo getNextServerFromEureka​(java.lang.String virtualHostname,
                                             boolean secure)
        Gets the next possible server to process the requests from the registry information received from eureka.

        The next server is picked on a round-robin fashion. By default, this method just returns the servers that are currently with InstanceInfo.InstanceStatus.UP status. This configuration can be controlled by overriding the EurekaClientConfig.shouldFilterOnlyUpInstances(). Note that in some cases (Eureka emergency mode situation), the instances that are returned may not be unreachable, it is solely up to the client at that point to timeout quickly and retry the next server.

        Parameters:
        virtualHostname - the virtual host name that is associated to the servers.
        secure - indicates whether this is a HTTP or a HTTPS request - secure means HTTPS.
        Returns:
        the InstanceInfo information which contains the public host name of the next server in line to process the request based on the round-robin algorithm.
        Throws:
        java.lang.RuntimeException - if the virtualHostname does not exist