Class DnsTxtRecordClusterResolver
- java.lang.Object
-
- com.netflix.discovery.shared.resolver.aws.DnsTxtRecordClusterResolver
-
- All Implemented Interfaces:
ClusterResolver<AwsEndpoint>
public class DnsTxtRecordClusterResolver extends java.lang.Object implements ClusterResolver<AwsEndpoint>
A cluster resolver implementation that assumes that Eureka cluster configuration is provided in two level, cascading DNS TXT records. The first level shall point to zone level DNS entries, while at the zone level server pools shall be provided (either CNAMEs or A records). If no TXT record is found at the provided address, the resolver will add 'txt.' suffix to the address, and try to resolve that address.Example
Lets assume we have a service with root domain myservice.net, and a deployment in AWS us-east-1 on all three zones. The root discovery domain would be:
DNS record TXT record content txt.myservice.net txt.us-east-1a.myservice.net txt.us-east-1b.myservice.net txt.us-east-1c.myservice.net txt.us-east-1a.myservice.net ec2-1-2-3-4.compute-1.amazonaws.com ec2-1-2-3-5.compute-1.amazonaws.com txt.us-east-1b.myservice.net ec2-1-2-3-6.compute-1.amazonaws.com ec2-1-2-3-7.compute-1.amazonaws.com txt.us-east-1c.myservice.net ec2-1-2-3-8.compute-1.amazonaws.com ec2-1-2-3-9.compute-1.amazonaws.com
-
-
Constructor Summary
Constructors Constructor Description DnsTxtRecordClusterResolver(java.lang.String region, java.lang.String rootClusterDNS, boolean extractZoneFromDNS, int port, boolean isSecure, java.lang.String relativeUri)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<AwsEndpoint>getClusterEndpoints()java.lang.StringgetRegion()
-
-
-
Constructor Detail
-
DnsTxtRecordClusterResolver
public DnsTxtRecordClusterResolver(java.lang.String region, java.lang.String rootClusterDNS, boolean extractZoneFromDNS, int port, boolean isSecure, java.lang.String relativeUri)- Parameters:
rootClusterDNS- top level domain name, in the two level hierarchy (seeDnsTxtRecordClusterResolverdocumentation).extractZoneFromDNS- if set to true, zone information will be extract from zone DNS name. It assumed that the zone name is the name part immediately followint 'txt.' suffix.port- Eureka sever port numberrelativeUri- service relative URI that will be appended to server address
-
-
Method Detail
-
getRegion
public java.lang.String getRegion()
- Specified by:
getRegionin interfaceClusterResolver<AwsEndpoint>
-
getClusterEndpoints
public java.util.List<AwsEndpoint> getClusterEndpoints()
- Specified by:
getClusterEndpointsin interfaceClusterResolver<AwsEndpoint>
-
-