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
,Listenable<List<Endpoint>>
,SafeCloseable
,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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
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, endpoints, initialEndpointsFuture, removeEndpoint, setEndpoints
-
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, awaitInitialEndpoints, awaitInitialEndpoints, orElse, removeListener
-
-
-
-
Method Detail
-
of
public static DnsServiceEndpointGroup of(String hostname)
Creates aDnsServiceEndpointGroup
that schedules queries on a randomEventLoop
fromCommonPools.workerGroup()
.- Parameters:
hostname
- the hostname to query DNS queries for.
-
close
public final void close()
Stops polling DNS servers for service updates.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceEndpointGroup
- Specified by:
close
in interfaceSafeCloseable
- Overrides:
close
in classDynamicEndpointGroup
-
-