@Singleton @Requires(classes={com.amazonaws.services.servicediscovery.AWSServiceDiscoveryAsync.class,io.micronaut.configuration.aws.AWSClientConfiguration.class}) @Requires(env="ec2") @Requires(beans=Route53DiscoveryConfiguration.class) @Requires(beans=io.micronaut.configuration.aws.AWSClientConfiguration.class) @Requires(property="aws.route53.discovery.enabled",value="true",defaultValue="false") public class Route53AutoNamingClient extends Object implements DiscoveryClient
DiscoveryClient
interface for AWS Route53.Modifier and Type | Field and Description |
---|---|
static String |
ENABLED
Configuration property for whether route53 is enabled.
|
Constructor and Description |
---|
Route53AutoNamingClient(io.micronaut.configuration.aws.AWSClientConfiguration awsClientConfiguration,
Route53ClientDiscoveryConfiguration route53ClientDiscoveryConfiguration,
AWSServiceDiscoveryResolver awsServiceDiscoveryResolver,
Environment environment)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close down AWS Client on shutdown.
|
String |
getDescription()
The description.
|
Publisher<List<ServiceInstance>> |
getInstances(String serviceId)
Gets a list of instances registered with Route53 given a service ID.
|
Route53ClientDiscoveryConfiguration |
getRoute53ClientDiscoveryConfiguration()
Used to help with testing.
|
Publisher<List<String>> |
getServiceIds()
Gets a list of service IDs from AWS for a given namespace.
|
void |
setRoute53ClientDiscoveryConfiguration(Route53ClientDiscoveryConfiguration route53ClientDiscoveryConfiguration)
Used to help with testing.
|
public static final String ENABLED
public Route53AutoNamingClient(io.micronaut.configuration.aws.AWSClientConfiguration awsClientConfiguration, Route53ClientDiscoveryConfiguration route53ClientDiscoveryConfiguration, AWSServiceDiscoveryResolver awsServiceDiscoveryResolver, Environment environment)
awsClientConfiguration
- The client configurationroute53ClientDiscoveryConfiguration
- The route 53 configurationawsServiceDiscoveryResolver
- The AWS service discovery resolverenvironment
- The environmentpublic Route53ClientDiscoveryConfiguration getRoute53ClientDiscoveryConfiguration()
public void setRoute53ClientDiscoveryConfiguration(Route53ClientDiscoveryConfiguration route53ClientDiscoveryConfiguration)
route53ClientDiscoveryConfiguration
- config classpublic String getDescription()
getDescription
in interface Described
public Publisher<List<ServiceInstance>> getInstances(String serviceId)
getInstances
in interface DiscoveryClient
serviceId
- The service idpublic Publisher<List<String>> getServiceIds()
getServiceIds
in interface DiscoveryClient
public void close()
close
in interface Closeable
close
in interface AutoCloseable