Class ServiceDiscoveryManager
java.lang.Object
ai.pipestream.dynamic.grpc.client.ServiceDiscoveryManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Void> ensureServiceDefined(String serviceName) Ensures a service is defined in Stork for discovery using the same Consul application name.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.io.smallrye.mutiny.Uni<List<io.smallrye.stork.api.ServiceInstance>> getServiceInstances(String serviceName) Gets service instances for a given service name
-
Constructor Details
-
ServiceDiscoveryManager
public ServiceDiscoveryManager()Default constructor for CDI frameworks.
-
-
Method Details
-
ensureServiceDefined
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 StorkconsulApplicationName- 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
-