Class ServiceDiscoveryManager

java.lang.Object
ai.pipestream.dynamic.grpc.client.ServiceDiscoveryManager

@ApplicationScoped public class ServiceDiscoveryManager extends Object
  • Constructor Details

    • ServiceDiscoveryManager

      public ServiceDiscoveryManager()
      Default constructor for CDI frameworks.
  • Method Details

    • ensureServiceDefined

      public io.smallrye.mutiny.Uni<Void> ensureServiceDefined(String serviceName)
      Ensures a service is defined in Stork for discovery using the same Consul application name.
      Parameters:
      serviceName - the logical service name to define and discover via Consul
      Returns:
      a Uni that completes when the service is defined or immediately if it already exists
    • ensureServiceDefinedFor

      public io.smallrye.mutiny.Uni<Void> ensureServiceDefinedFor(String storkServiceName, String consulApplicationName)
      Ensures a service is defined in Stork under the given storkServiceName but discovers Consul instances registered under consulApplicationName.
      Parameters:
      storkServiceName - the logical service name as it will be known to Stork
      consulApplicationName - the Consul service name to query for instances
      Returns:
      a Uni that completes when the service is defined or fails if definition cannot be created
    • getServiceInstances

      public io.smallrye.mutiny.Uni<List<io.smallrye.stork.api.ServiceInstance>> getServiceInstances(String serviceName)
      Gets service instances for a given service name