Class DnsAddressEndpointGroupBuilder
java.lang.Object
com.linecorp.armeria.client.endpoint.dns.DnsAddressEndpointGroupBuilder
Builds a new
DnsAddressEndpointGroup
that sources its Endpoint
list from the A
or
AAAA
DNS records of a certain hostname.-
Method Summary
Modifier and TypeMethodDescriptionSets theBackoff
that determines how much delay should be inserted between queries when a DNS server sent an error response.build()
Returns a newly createdDnsAddressEndpointGroup
.Sets theEventLoop
to use for sending DNS queries.port
(int port) Sets the port number of theEndpoint
s created byDnsAddressEndpointGroup
.queryTimeout
(Duration queryTimeout) Sets the timeout of the DNS query performed by this endpoint group.queryTimeoutMillis
(long queryTimeoutMillis) Sets the timeout of the DNS query performed by this endpoint group in milliseconds.selectionStrategy
(EndpointSelectionStrategy selectionStrategy) Sets theEndpointSelectionStrategy
that determines the enumeration order ofEndpoint
s.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.ttl
(int minTtl, int maxTtl) Sets the minimum and maximum TTL of the DNS records (in seconds).
-
Method Details
-
port
Sets the port number of theEndpoint
s created byDnsAddressEndpointGroup
. By default, the port number of theEndpoint
s will remain unspecified and the protocol-dependent default port number will be chosen automatically, e.g. 80 or 443. -
build
Returns a newly createdDnsAddressEndpointGroup
. -
eventLoop
Sets theEventLoop
to use for sending DNS queries. -
ttl
Sets the minimum and maximum TTL of the DNS records (in seconds). If the TTL of the DNS record returned by the DNS server is less than the minimum TTL or greater than the maximum TTL, the TTL from the DNS server will be ignored andminTtl
ormaxTtl
will be used respectively. The defaultminTtl
andmaxTtl
are1
andInteger.MAX_VALUE
, which practically tells to respect the server TTL. -
queryTimeout
Sets the timeout of the DNS query performed by this endpoint group.0
disables the timeout. -
queryTimeoutMillis
Sets the timeout of the DNS query performed by this endpoint group in milliseconds.0
disables the timeout. -
serverAddresses
Sets the DNS server addresses to send queries to. Operating system default is used by default. -
serverAddresses
Sets the DNS server addresses to send queries to. Operating system default is used by default. -
backoff
Sets theBackoff
that 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
public DnsAddressEndpointGroupBuilder selectionStrategy(EndpointSelectionStrategy selectionStrategy) Sets theEndpointSelectionStrategy
that determines the enumeration order ofEndpoint
s.
-