Class DnsTextEndpointGroupBuilder
- All Implemented Interfaces:
DynamicEndpointGroupSetters
DnsTextEndpointGroup that sources its Endpoint list from the TXT
DNS records of a certain hostname.-
Method Summary
Modifier and TypeMethodDescriptionaddDnsQueryListeners(DnsQueryListener... dnsQueryListeners) Adds theDnsQueryListenerthat listens to the result ofDnsRecordqueries.addDnsQueryListeners(Iterable<? extends DnsQueryListener> dnsQueryListeners) Adds theDnsQueryListeners which listens to the result ofDnsRecordqueries.allowEmptyEndpoints(boolean allowEmptyEndpoints) Sets whether to allow an emptyEndpointlist.Sets theBackoffthat determines how much delay should be inserted between queries when a DNS server sent an error response.build()Returns a newly createdDnsTextEndpointGroup.Sets the Caffeine specification string of the cache that stores the domain names and their resolved addresses.decodeIdn(boolean decodeIdn) Sets if the domain and host names should be decoded to unicode when received.Deprecated.dnsQueryLifecycleObserverFactory(DnsQueryLifecycleObserverFactory observerFactory) Sets theDnsQueryLifecycleObserverFactorythat is used to generate objects which can observe individual DNS queries.dnsServerAddressStreamProvider(DnsServerAddressStreamProvider dnsServerAddressStreamProvider) Deprecated.enableDnsQueryMetrics(boolean enable) Enables the defaultDnsQueryLifecycleObserverFactorythat collects DNS query metrics throughMeterRegistry.Sets theEventLoopto use for sending DNS queries.hostsFileEntriesResolver(HostsFileEntriesResolver hostsFileEntriesResolver) Sets theHostsFileEntriesResolverwhich is used to first check if the hostname is locally aliased.maxPayloadSize(int maxPayloadSize) Sets the capacity of the datagram packet buffer in bytes.maxQueriesPerResolve(int maxQueriesPerResolve) Sets the base value of maximum allowed number of DNS queries to send when resolving a host name.meterRegistry(MeterRegistry meterRegistry) SetsMeterRegistryto collect the DNS query metrics.ndots(int ndots) Sets the number of dots which must appear in a name before an initial absolute query is made.negativeTtl(int negativeTtl) Sets the TTL of the cache for the failed DNS queries in seconds.optResourceEnabled(boolean optResourceEnabled) Enables the automatic inclusion of an optional records that tries to give the remote DNS server a hint about how much data the resolver can read per response.queryTimeout(Duration queryTimeout) Sets the timeout of the DNS query performed by this resolver.queryTimeoutForEachAttempt(Duration queryTimeoutForEachAttempt) Sets the timeout of each DNS query performed by this endpoint group.queryTimeoutMillis(long queryTimeoutMillis) Sets the timeout of the DNS query performed by this resolver in milliseconds.queryTimeoutMillisForEachAttempt(long queryTimeoutMillisForEachAttempt) Sets the timeout of each DNS query performed by this endpoint group in milliseconds.recursionDesired(boolean recursionDesired) Sets if this resolver has to send a DNS query with the RD (recursion desired) flag set.searchDomains(Iterable<String> searchDomains) Sets the list of search domains of the resolver.searchDomains(String... searchDomains) Sets the search domains of the resolver.selectionStrategy(EndpointSelectionStrategy selectionStrategy) Sets theEndpointSelectionStrategythat determines the enumeration order ofEndpoints.selectionTimeout(Duration selectionTimeout) Sets the timeout to wait until a successfulEndpointselection.selectionTimeoutMillis(long selectionTimeoutMillis) Sets the timeout to wait until a successfulEndpointselection.serverAddresses(Iterable<InetSocketAddress> serverAddresses) Sets the DNS server addresses to send queries to.serverAddresses(InetSocketAddress... serverAddresses) Sets the DNS server addresses to send queries to.serverAddressStreamProvider(DnsServerAddressStreamProvider serverAddressStreamProvider) Sets theDnsServerAddressStreamProviderwhich is used to determine which DNS server is used to resolve each hostname.traceEnabled(boolean traceEnabled) Sets if this resolver should generate detailed trace information in exception messages so that it is easier to understand the cause of resolution failure.ttl(int minTtl, int maxTtl) Sets the minimum and maximum TTL of the cached DNS resource records in seconds.Methods inherited from class com.linecorp.armeria.client.AbstractDnsResolverBuilder
buildConfigurator, cacheSpec, hostsFileEntriesResolver, maxTtl, maybeCreateDnsCache, meterRegistry, minTtl, ndots, negativeTtl, queryTimeoutMillis, searchDomains, serverAddressStreamProvider
-
Method Details
-
build
Returns a newly createdDnsTextEndpointGroup. -
eventLoop
Sets theEventLoopto use for sending DNS queries. -
backoff
Sets theBackoffthat determines how much delay should be inserted between queries when a DNS server sent an error response.Backoff.exponential(1000, 32000).withJitter(0.2)is used by default. -
selectionStrategy
Sets theEndpointSelectionStrategythat determines the enumeration order ofEndpoints. -
traceEnabled
Description copied from class:AbstractDnsResolverBuilderSets if this resolver should generate detailed trace information in exception messages so that it is easier to understand the cause of resolution failure. This flag is enabled by default.- Overrides:
traceEnabledin classAbstractDnsResolverBuilder
-
queryTimeout
Description copied from class:AbstractDnsResolverBuilderSets the timeout of the DNS query performed by this resolver.0disables the timeout. If unspecified, 5000 ms will be used.- Overrides:
queryTimeoutin classAbstractDnsResolverBuilder
-
queryTimeoutMillis
Description copied from class:AbstractDnsResolverBuilderSets the timeout of the DNS query performed by this resolver in milliseconds.0disables the timeout. If unspecified, 5000 ms will be used.- Overrides:
queryTimeoutMillisin classAbstractDnsResolverBuilder
-
queryTimeoutForEachAttempt
Description copied from class:AbstractDnsResolverBuilderSets the timeout of each DNS query performed by this endpoint group. This option is useful if you want to set a timeout for each search domain resolution. If unspecified, the value ofAbstractDnsResolverBuilder.queryTimeout(Duration)is used.- Overrides:
queryTimeoutForEachAttemptin classAbstractDnsResolverBuilder
-
queryTimeoutMillisForEachAttempt
public DnsTextEndpointGroupBuilder queryTimeoutMillisForEachAttempt(long queryTimeoutMillisForEachAttempt) Description copied from class:AbstractDnsResolverBuilderSets the timeout of each DNS query performed by this endpoint group in milliseconds. This option is useful if you want to set a timeout for each search domain resolution. If unspecified, the value ofAbstractDnsResolverBuilder.queryTimeoutMillis(long)is used.- Overrides:
queryTimeoutMillisForEachAttemptin classAbstractDnsResolverBuilder
-
recursionDesired
Description copied from class:AbstractDnsResolverBuilderSets if this resolver has to send a DNS query with the RD (recursion desired) flag set. This flag is enabled by default.- Overrides:
recursionDesiredin classAbstractDnsResolverBuilder
-
maxQueriesPerResolve
Description copied from class:AbstractDnsResolverBuilderSets the base value of maximum allowed number of DNS queries to send when resolving a host name. The actual maximum allowed number of queries will be multiplied by theDnsServerAddressStream.size(). For example, ifmaxQueriesPerResolveis 5 andDnsServerAddressStream.size()is 2, DNS queries can be executed up to 10 times. TheDnsServerAddressStreamis provided byDnsServerAddressStreamProvider. -
serverAddresses
Description copied from class:AbstractDnsResolverBuilderSets the DNS server addresses to send queries to. Operating system default is used by default.- Overrides:
serverAddressesin classAbstractDnsResolverBuilder
-
serverAddresses
Description copied from class:AbstractDnsResolverBuilderSets the DNS server addresses to send queries to. Operating system default is used by default.- Overrides:
serverAddressesin classAbstractDnsResolverBuilder
-
serverAddressStreamProvider
public DnsTextEndpointGroupBuilder serverAddressStreamProvider(DnsServerAddressStreamProvider serverAddressStreamProvider) Description copied from class:AbstractDnsResolverBuilderSets theDnsServerAddressStreamProviderwhich is used to determine which DNS server is used to resolve each hostname.- Overrides:
serverAddressStreamProviderin classAbstractDnsResolverBuilder
-
dnsServerAddressStreamProvider
@Deprecated public DnsTextEndpointGroupBuilder dnsServerAddressStreamProvider(DnsServerAddressStreamProvider dnsServerAddressStreamProvider) Deprecated.Description copied from class:AbstractDnsResolverBuilderSets theDnsServerAddressStreamProviderwhich is used to determine which DNS server is used to resolve each hostname.- Overrides:
dnsServerAddressStreamProviderin classAbstractDnsResolverBuilder
-
maxPayloadSize
Description copied from class:AbstractDnsResolverBuilderSets the capacity of the datagram packet buffer in bytes.- Overrides:
maxPayloadSizein classAbstractDnsResolverBuilder
-
optResourceEnabled
Description copied from class:AbstractDnsResolverBuilderEnables the automatic inclusion of an optional records that tries to give the remote DNS server a hint about how much data the resolver can read per response. Some DNS Server may not support this and so fail to answer queries.- Overrides:
optResourceEnabledin classAbstractDnsResolverBuilder
-
hostsFileEntriesResolver
public DnsTextEndpointGroupBuilder hostsFileEntriesResolver(HostsFileEntriesResolver hostsFileEntriesResolver) Description copied from class:AbstractDnsResolverBuilderSets theHostsFileEntriesResolverwhich is used to first check if the hostname is locally aliased.- Overrides:
hostsFileEntriesResolverin classAbstractDnsResolverBuilder
-
dnsQueryLifecycleObserverFactory
public DnsTextEndpointGroupBuilder dnsQueryLifecycleObserverFactory(DnsQueryLifecycleObserverFactory observerFactory) Description copied from class:AbstractDnsResolverBuilderSets theDnsQueryLifecycleObserverFactorythat is used to generate objects which can observe individual DNS queries.- Overrides:
dnsQueryLifecycleObserverFactoryin classAbstractDnsResolverBuilder
-
disableDnsQueryMetrics
Deprecated.Description copied from class:AbstractDnsResolverBuilderDisables the defaultDnsQueryLifecycleObserverFactorythat collects DNS query metrics throughMeterRegistry.- Overrides:
disableDnsQueryMetricsin classAbstractDnsResolverBuilder
-
enableDnsQueryMetrics
Description copied from class:AbstractDnsResolverBuilderEnables the defaultDnsQueryLifecycleObserverFactorythat collects DNS query metrics throughMeterRegistry. This option is enabled by default.- Overrides:
enableDnsQueryMetricsin classAbstractDnsResolverBuilder
-
searchDomains
Description copied from class:AbstractDnsResolverBuilderSets the search domains of the resolver.- Overrides:
searchDomainsin classAbstractDnsResolverBuilder
-
searchDomains
Description copied from class:AbstractDnsResolverBuilderSets the list of search domains of the resolver.- Overrides:
searchDomainsin classAbstractDnsResolverBuilder
-
ndots
Description copied from class:AbstractDnsResolverBuilderSets the number of dots which must appear in a name before an initial absolute query is made.- Overrides:
ndotsin classAbstractDnsResolverBuilder
-
decodeIdn
Description copied from class:AbstractDnsResolverBuilderSets if the domain and host names should be decoded to unicode when received. See rfc3492. This flag is enabled by default.- Overrides:
decodeIdnin classAbstractDnsResolverBuilder
-
meterRegistry
Description copied from class:AbstractDnsResolverBuilderSetsMeterRegistryto collect the DNS query metrics.- Overrides:
meterRegistryin classAbstractDnsResolverBuilder
-
cacheSpec
Description copied from class:AbstractDnsResolverBuilderSets the Caffeine specification string of the cache that stores the domain names and their resolved addresses. If not set,Flags.dnsCacheSpec()is used by default.Note that
AbstractDnsResolverBuilder.cacheSpec(String)andAbstractDnsResolverBuilder.dnsCache(DnsCache)are mutually exclusive.- Overrides:
cacheSpecin classAbstractDnsResolverBuilder
-
ttl
Description copied from class:AbstractDnsResolverBuilderSets the minimum and maximum TTL of the cached DNS resource records in seconds. If the TTL of the DNS resource record returned by the DNS server is less than the minimum TTL or greater than the maximum TTL, this resolver will ignore the TTL from the DNS server and use the minimum TTL or the maximum TTL instead respectively. The default value is1andInteger.MAX_VALUE, which practically tells this resolver to respect the TTL from the DNS server.Note that
AbstractDnsResolverBuilder.ttl(int, int)andAbstractDnsResolverBuilder.dnsCache(DnsCache)are mutually exclusive.- Overrides:
ttlin classAbstractDnsResolverBuilder
-
negativeTtl
Description copied from class:AbstractDnsResolverBuilderSets the TTL of the cache for the failed DNS queries in seconds. The default value is0which means that the DNS resolver does not cache when DNS queries are failed.Note that
AbstractDnsResolverBuilder.negativeTtl(int)andAbstractDnsResolverBuilder.dnsCache(DnsCache)are mutually exclusive.- Overrides:
negativeTtlin classAbstractDnsResolverBuilder
-
dnsCache
Description copied from class:AbstractDnsResolverBuilderSets theDnsCachethat caches the resolvedDnsRecords and the cause of a failure if negative cache is activated. This option is useful if you want to share aDnsCachewith multiple DNS resolvers. If unspecified, the defaultDnsCacheis used.Note that if
AbstractDnsResolverBuilder.cacheSpec(String),AbstractDnsResolverBuilder.ttl(int, int), orAbstractDnsResolverBuilder.negativeTtl(int)is set, the DNS resolver will create its ownDnsCacheusing the properties. Therefore,AbstractDnsResolverBuilder.cacheSpec(String),AbstractDnsResolverBuilder.ttl(int, int), andAbstractDnsResolverBuilder.negativeTtl(int)are mutually exclusive withAbstractDnsResolverBuilder.dnsCache(DnsCache).- Overrides:
dnsCachein classAbstractDnsResolverBuilder
-
allowEmptyEndpoints
Description copied from interface:DynamicEndpointGroupSetters- Specified by:
allowEmptyEndpointsin interfaceDynamicEndpointGroupSetters
-
selectionTimeout
Description copied from interface:DynamicEndpointGroupSettersSets the timeout to wait until a successfulEndpointselection.Duration.ZEROdisables the timeout. If unspecified,Flags.defaultConnectTimeoutMillis()is used by default.- Specified by:
selectionTimeoutin interfaceDynamicEndpointGroupSetters
-
selectionTimeoutMillis
Sets the timeout to wait until a successfulEndpointselection.0disables the timeout. If unspecified, the default DNS query timeout (DnsUtil.DEFAULT_DNS_QUERY_TIMEOUT_MILLISms) is used by default.- Specified by:
selectionTimeoutMillisin interfaceDynamicEndpointGroupSetters
-
addDnsQueryListeners
public DnsTextEndpointGroupBuilder addDnsQueryListeners(Iterable<? extends DnsQueryListener> dnsQueryListeners) Adds theDnsQueryListeners which listens to the result ofDnsRecordqueries. If noDnsQueryListeneris configured,DnsQueryListener.of()is used by default. -
addDnsQueryListeners
Adds theDnsQueryListenerthat listens to the result ofDnsRecordqueries. If noDnsQueryListeneris configured,DnsQueryListener.of()is used by default.
-