Package com.linecorp.armeria.xds
Class XdsEndpointGroup
java.lang.Object
com.linecorp.armeria.common.util.AbstractListenable<List<Endpoint>>
com.linecorp.armeria.client.endpoint.DynamicEndpointGroup
com.linecorp.armeria.xds.XdsEndpointGroup
- All Implemented Interfaces:
EndpointGroup
,EndpointSelector
,AsyncCloseable
,Listenable<List<Endpoint>>
,ListenableAsyncCloseable
,AutoCloseable
Provides a simple
EndpointGroup
which listens to an xDS cluster to select endpoints.
Listening to EDS can be done like the following:
XdsBootstrap watchersStorage = XdsBootstrap.of(...);
EndpointGroup endpointGroup = XdsEndpointGroup.of(watchersStorage, "my-cluster");
WebClient client = WebClient.of(SessionProtocol.HTTP, endpointGroup);
Currently, all SocketAddress
es of a ClusterLoadAssignment
are aggregated
to a list and added to this EndpointGroup
. Features such as automatic TLS detection
or locality based load balancing are not supported yet.
Note that it is important to shut down the endpoint group to clean up resources
for the provided XdsBootstrap
.-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doCloseAsync
(CompletableFuture<?> future) Override this method to release the resources held by thisEndpointGroup
and complete the specifiedCompletableFuture
.static EndpointGroup
of
(ListenerRoot listenerRoot) Creates aXdsEndpointGroup
which listens to the specified listener.Methods inherited from class com.linecorp.armeria.client.endpoint.DynamicEndpointGroup
addEndpoint, allowsEmptyEndpoints, builder, close, closeAsync, endpoints, isClosed, isClosing, latestValue, removeEndpoint, select, select, selectionStrategy, selectionTimeoutMillis, selectNow, setEndpoints, toString, toString, whenClosed, whenReady
Methods inherited from class com.linecorp.armeria.common.util.AbstractListenable
addListener, addListener, notifyListeners, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.linecorp.armeria.client.endpoint.EndpointGroup
addListener, addListener, orElse, removeListener
-
Method Details
-
of
Creates aXdsEndpointGroup
which listens to the specified listener. -
doCloseAsync
Description copied from class:DynamicEndpointGroup
Override this method to release the resources held by thisEndpointGroup
and complete the specifiedCompletableFuture
.- Overrides:
doCloseAsync
in classDynamicEndpointGroup
-