Interface RegistryClient

All Known Implementing Classes:
ConsulRegistryClient, EurekaRegistryClient, MultiRegistryClient, NoOpRegistryClient

public interface RegistryClient
Base of all registry client implementations in order to find running services
  • Method Details

    • findServiceInstanceBy

      default Optional<ServiceInstance> findServiceInstanceBy(String serviceName)
      Attempts to find a service instance with the given service name.

      If there are more than one instance, the implementation should decide the order in which the service is returned (e.g. round-robin, random, LIFO, FIFO, etc.)

      Parameters:
      serviceName - The name of the service that is being requested
      Returns:
      an Optional containing the found service or Optional.empty()
    • findServiceInstanceBy

      Optional<ServiceInstance> findServiceInstanceBy(String serviceName, String instanceId)
      Attempts to find a service instance with the given service name and the given instance id.
      Parameters:
      serviceName - The name of the service that is being requested
      instanceId - The id of the instance that is wanted
      Returns:
      an Optional containing the found service or Optional.empty()
    • findServiceInstanceBy

      default Optional<ServiceInstance> findServiceInstanceBy(RegistryClient.InstanceQuery query)
      Attempts to find a service instance from the given RegistryClient.InstanceQuery.

      If there are more than one instance, the implementation should decide the order in which the service is returned (e.g. round-robin, random, LIFO, FIFO, etc.)

      Parameters:
      query - a RegistryClient.InstanceQuery containing the search parameters to find the instance
      Returns:
      an Optional containing the found service or Optional.empty()
    • findAllServiceInstancesBy

      default List<ServiceInstance> findAllServiceInstancesBy(String serviceName)
      Attempts to find all service instances with the given service name.
      Parameters:
      serviceName - The name of the service that is being requested
      Returns:
      a List containing the found services
    • findAllServiceInstancesBy

      List<ServiceInstance> findAllServiceInstancesBy(RegistryClient.InstanceQuery query)
      Attempts to find all service instances from the given RegistryClient.InstanceQuery.
      Parameters:
      query - a RegistryClient.InstanceQuery containing the search parameters to find the instance
      Returns:
      a List containing the found services
    • retrieveAllRegisteredInstances

      List<ServiceInstance> retrieveAllRegisteredInstances()
      Retrieves all registered service instances from the registry.
      Returns:
      a List containing all registered service instances