Class DnsServiceEndpointGroup
java.lang.Object
com.linecorp.armeria.common.util.AbstractListenable<List<Endpoint>>
com.linecorp.armeria.client.endpoint.DynamicEndpointGroup
com.linecorp.armeria.client.endpoint.dns.DnsServiceEndpointGroup
- All Implemented Interfaces:
EndpointGroup
,EndpointSelector
,AsyncCloseable
,Listenable<List<Endpoint>>
,ListenableAsyncCloseable
,AutoCloseable
public final class DnsServiceEndpointGroup extends DynamicEndpointGroup
DynamicEndpointGroup
which resolves targets using DNS
SRV records. This is useful for environments
where service discovery is handled using DNS, e.g.
Kubernetes DNS-based service
discovery.-
Method Summary
Modifier and Type Method Description static DnsServiceEndpointGroupBuilder
builder(String hostname)
Returns a newDnsServiceEndpointGroupBuilder
with the specified hostname.protected void
doCloseAsync(CompletableFuture<?> future)
Stops polling DNS servers for service updates.static DnsServiceEndpointGroup
of(String hostname)
Creates aDnsServiceEndpointGroup
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 aDnsServiceEndpointGroup
that schedules queries on a randomEventLoop
fromCommonPools.workerGroup()
.- Parameters:
hostname
- the hostname to query DNS queries for.
-
builder
Returns a newDnsServiceEndpointGroupBuilder
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
-