Class AwsServiceDiscoveryClient
java.lang.Object
io.micronaut.discovery.aws.servicediscovery.client.AwsServiceDiscoveryClient
- All Implemented Interfaces:
io.micronaut.core.naming.Described
,io.micronaut.discovery.DiscoveryClient
,Closeable
,AutoCloseable
@Internal
@Singleton
@Requires(property="aws.service-discovery.enabled",value="true",defaultValue="false") @Requires(classes=software.amazon.awssdk.services.servicediscovery.ServiceDiscoveryAsyncClient.class) @Requires(env="ec2") @Requires(beans=AwsServiceDiscoveryConfiguration.class)
public class AwsServiceDiscoveryClient
extends Object
implements io.micronaut.discovery.DiscoveryClient
An implementation of the
DiscoveryClient
interface for AWS Route53.- Since:
- 1.0
- Author:
- Rvanderwerf, graemerocher
-
Constructor Summary
ConstructorDescriptionAwsServiceDiscoveryClient
(AwsServiceDiscoveryClientConfiguration awsServiceDiscoveryClientConfiguration, software.amazon.awssdk.services.servicediscovery.ServiceDiscoveryAsyncClient serviceDiscoveryAsyncClient) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close down AWS Client on shutdown.The description.org.reactivestreams.Publisher<List<io.micronaut.discovery.ServiceInstance>>
getInstances
(String serviceId) Gets a list of instances registered with Route53 given a service ID.Gets a list of service IDs from AWS for a given namespace.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.naming.Described
getDescription
-
Constructor Details
-
AwsServiceDiscoveryClient
public AwsServiceDiscoveryClient(AwsServiceDiscoveryClientConfiguration awsServiceDiscoveryClientConfiguration, software.amazon.awssdk.services.servicediscovery.ServiceDiscoveryAsyncClient serviceDiscoveryAsyncClient) Default constructor.- Parameters:
awsServiceDiscoveryClientConfiguration
- The discovery configurationserviceDiscoveryAsyncClient
- The AWS serviceDiscoveryAsyncClient
-
-
Method Details
-
getDescription
The description.- Specified by:
getDescription
in interfaceio.micronaut.core.naming.Described
-
getInstances
public org.reactivestreams.Publisher<List<io.micronaut.discovery.ServiceInstance>> getInstances(String serviceId) Gets a list of instances registered with Route53 given a service ID.- Specified by:
getInstances
in interfaceio.micronaut.discovery.DiscoveryClient
- Parameters:
serviceId
- The service id- Returns:
- list of serviceInstances usable by MN.
-
getServiceIds
Gets a list of service IDs from AWS for a given namespace.- Specified by:
getServiceIds
in interfaceio.micronaut.discovery.DiscoveryClient
- Returns:
- publisher list of the service IDs in string format
-
close
public void close()Close down AWS Client on shutdown.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-