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 Details

    • AwsServiceDiscoveryClient

      public AwsServiceDiscoveryClient(AwsServiceDiscoveryClientConfiguration awsServiceDiscoveryClientConfiguration, software.amazon.awssdk.services.servicediscovery.ServiceDiscoveryAsyncClient serviceDiscoveryAsyncClient)
      Default constructor.
      Parameters:
      awsServiceDiscoveryClientConfiguration - The discovery configuration
      serviceDiscoveryAsyncClient - The AWS serviceDiscoveryAsyncClient
  • Method Details

    • getDescription

      public String getDescription()
      The description.
      Specified by:
      getDescription in interface io.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 interface io.micronaut.discovery.DiscoveryClient
      Parameters:
      serviceId - The service id
      Returns:
      list of serviceInstances usable by MN.
    • getServiceIds

      public org.reactivestreams.Publisher<List<String>> getServiceIds()
      Gets a list of service IDs from AWS for a given namespace.
      Specified by:
      getServiceIds in interface io.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 interface AutoCloseable
      Specified by:
      close in interface Closeable