Class ConsulEndpointGroup
java.lang.Object
com.linecorp.armeria.common.util.AbstractListenable<List<Endpoint>>
com.linecorp.armeria.client.endpoint.DynamicEndpointGroup
com.linecorp.armeria.client.consul.ConsulEndpointGroup
- All Implemented Interfaces:
EndpointGroup,EndpointSelector,AsyncCloseable,Listenable<List<Endpoint>>,ListenableAsyncCloseable,AutoCloseable
A Consul-based
EndpointGroup implementation that retrieves the list of Endpoints
from Consul using Consul's HTTP API and updates the
Endpoints periodically.-
Method Summary
Modifier and TypeMethodDescriptionstatic ConsulEndpointGroupBuilderReturns a newly-createdConsulEndpointGroupBuilderwith the specifiedconsulUriandserviceNameto buildConsulEndpointGroupBuilder.protected voiddoCloseAsync(CompletableFuture<?> future) Override this method to release the resources held by thisEndpointGroupand complete the specifiedCompletableFuture.static ConsulEndpointGroupReturns aConsulEndpointGroupwith the specifiedserviceName.toString()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, toStringSelector, whenClosed, whenReadyMethods inherited from class com.linecorp.armeria.common.util.AbstractListenable
addListener, addListener, notifyListeners, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.linecorp.armeria.client.endpoint.EndpointGroup
addListener, addListener, orElse, removeListener
-
Method Details
-
of
Returns aConsulEndpointGroupwith the specifiedserviceName. The returnedConsulEndpointGroupwill retrieve the list ofEndpoints from a local Consul agent at the default Consul service port.- Parameters:
consulUri- the URI of Consul API serviceserviceName- the service name to register
-
builder
Returns a newly-createdConsulEndpointGroupBuilderwith the specifiedconsulUriandserviceNameto buildConsulEndpointGroupBuilder.- Parameters:
consulUri- the URI of Consul API serviceserviceName- the service name to register
-
doCloseAsync
Description copied from class:DynamicEndpointGroupOverride this method to release the resources held by thisEndpointGroupand complete the specifiedCompletableFuture.- Overrides:
doCloseAsyncin classDynamicEndpointGroup
-
toString
- Overrides:
toStringin classDynamicEndpointGroup
-