Class DnsAddressEndpointGroup
java.lang.Object
com.linecorp.armeria.common.util.AbstractListenable<List<Endpoint>>
com.linecorp.armeria.client.endpoint.DynamicEndpointGroup
com.linecorp.armeria.client.endpoint.dns.DnsAddressEndpointGroup
- All Implemented Interfaces:
EndpointGroup
,EndpointSelector
,AsyncCloseable
,Listenable<List<Endpoint>>
,ListenableAsyncCloseable
,AutoCloseable
DynamicEndpointGroup
which resolves targets using DNS address queries (A
and AAAA
).
This is useful for environments where service discovery is handled using DNS, e.g.
Kubernetes DNS-based service
discovery.-
Method Summary
Modifier and TypeMethodDescriptionReturns a newDnsAddressEndpointGroupBuilder
with the specified hostname.protected void
doCloseAsync(CompletableFuture<?> future)
Stops polling DNS servers for service updates.static DnsAddressEndpointGroup
Creates aDnsAddressEndpointGroup
with an unspecified port that schedules queries on a randomEventLoop
fromCommonPools.workerGroup()
.static DnsAddressEndpointGroup
Creates aDnsAddressEndpointGroup
that schedules queries on a randomEventLoop
fromCommonPools.workerGroup()
.Methods inherited from class com.linecorp.armeria.client.endpoint.DynamicEndpointGroup
addEndpoint, close, closeAsync, endpoints, isClosed, isClosing, removeEndpoint, select, selectionStrategy, selectNow, setEndpoints, whenClosed, whenReady
Methods inherited from class com.linecorp.armeria.common.util.AbstractListenable
addListener, notifyListeners, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.linecorp.armeria.client.endpoint.EndpointGroup
addListener, orElse, removeListener
-
Method Details
-
of
Creates aDnsAddressEndpointGroup
with an unspecified port that schedules queries on a randomEventLoop
fromCommonPools.workerGroup()
.- Parameters:
hostname
- the hostname to query DNS queries for
-
of
Creates aDnsAddressEndpointGroup
that schedules queries on a randomEventLoop
fromCommonPools.workerGroup()
.- Parameters:
hostname
- the hostname to query DNS queries forport
- the port of theEndpoint
s
-
builder
Returns a newDnsAddressEndpointGroupBuilder
with the specified hostname.- Parameters:
hostname
- the hostname to query DNS queries for
-
doCloseAsync
Stops polling DNS servers for service updates.- Overrides:
doCloseAsync
in classDynamicEndpointGroup
-