@Internal @Singleton @Requires(classes=software.amazon.awssdk.services.servicediscovery.ServiceDiscoveryClient.class) @Requires(env="ec2") @Requires(beans=AwsServiceDiscoveryRegistrationConfiguration.class) @Requires(property="aws.service-discovery.registration.enabled",value="true",defaultValue="false") @Requires(property="micronaut.application.name") public class AwsServiceDiscoveryRegistrationClient extends io.micronaut.discovery.client.registration.DiscoveryServiceAutoRegistration
DiscoveryServiceAutoRegistration
for Route 53.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AWS_ALIAS_DNS_NAME
Constant for AWS alias dns name.
|
static java.lang.String |
AWS_INSTANCE_CNAME
Constant for AWS instance cname.
|
static java.lang.String |
AWS_INSTANCE_IPV4
Constant for AWS intance IPv4.
|
static java.lang.String |
AWS_INSTANCE_IPV6
Constant for AWS instance IPv6.
|
static java.lang.String |
AWS_INSTANCE_PORT
Constant for AWS instance port.
|
static java.lang.String |
ENABLED
Constant for whether route 53 registration is enabled.
|
Modifier | Constructor and Description |
---|---|
protected |
AwsServiceDiscoveryRegistrationClient(io.micronaut.context.env.Environment environment,
AwsServiceDiscoveryRegistrationConfiguration awsServiceDiscoveryRegistrationConfiguration,
AmazonComputeInstanceMetadataResolver amazonComputeInstanceMetadataResolver,
java.util.concurrent.Executor executorService,
software.amazon.awssdk.services.servicediscovery.ServiceDiscoveryClient serviceDiscoveryClient,
software.amazon.awssdk.services.servicediscovery.ServiceDiscoveryAsyncClient serviceDiscoveryAsyncClient)
Constructor for setup.
|
Modifier and Type | Method and Description |
---|---|
void |
deregister(io.micronaut.discovery.ServiceInstance instance)
shutdown instance if it fails health check can gracefully stop.
|
protected void |
pulsate(io.micronaut.discovery.ServiceInstance instance,
io.micronaut.health.HealthStatus status)
If custom health check is enabled, this sends a heartbeat to it.
|
void |
register(io.micronaut.discovery.ServiceInstance instance)
register new instance to the service registry.
|
getErrorMessage, performDeregistration, performRegistration
onApplicationEvent, validateApplicationName, validateName
public static final java.lang.String AWS_INSTANCE_PORT
public static final java.lang.String AWS_INSTANCE_IPV4
public static final java.lang.String AWS_INSTANCE_CNAME
public static final java.lang.String AWS_INSTANCE_IPV6
public static final java.lang.String AWS_ALIAS_DNS_NAME
public static final java.lang.String ENABLED
protected AwsServiceDiscoveryRegistrationClient(io.micronaut.context.env.Environment environment, AwsServiceDiscoveryRegistrationConfiguration awsServiceDiscoveryRegistrationConfiguration, AmazonComputeInstanceMetadataResolver amazonComputeInstanceMetadataResolver, @Named(value="io") java.util.concurrent.Executor executorService, software.amazon.awssdk.services.servicediscovery.ServiceDiscoveryClient serviceDiscoveryClient, software.amazon.awssdk.services.servicediscovery.ServiceDiscoveryAsyncClient serviceDiscoveryAsyncClient)
environment
- current environmentawsServiceDiscoveryRegistrationConfiguration
- config for auto registrationamazonComputeInstanceMetadataResolver
- resolver for aws compute metdataexecutorService
- this is for executing the thread to monitor the register operation for completionserviceDiscoveryClient
- the serviceDiscoveryClientserviceDiscoveryAsyncClient
- the serviceDiscoveryAsyncClientprotected void pulsate(io.micronaut.discovery.ServiceInstance instance, io.micronaut.health.HealthStatus status)
pulsate
in class io.micronaut.discovery.registration.AutoRegistration
instance
- The instance of the servicestatus
- The HealthStatus
public void deregister(io.micronaut.discovery.ServiceInstance instance)
deregister
in class io.micronaut.discovery.registration.AutoRegistration
public void register(io.micronaut.discovery.ServiceInstance instance)
register
in class io.micronaut.discovery.registration.AutoRegistration
instance
- The ServiceInstance