Class CentralDogmaEndpointGroup<T>

Type Parameters:
T - the type of the file in Central Dogma
All Implemented Interfaces:
EndpointGroup, EndpointSelector, AsyncCloseable, Listenable<List<Endpoint>>, ListenableAsyncCloseable, AutoCloseable

public final class CentralDogmaEndpointGroup<T> extends DynamicEndpointGroup
A DynamicEndpointGroup implementation that retrieves the Endpoint list from an entry in Central Dogma. The entry can be a JSON file or a plain text file.

For example, the following JSON array will be served as a list of Endpoints:


  [
      "host1:port1",
      "host2:port2",
      "host3:port3"
  ]
 

The JSON array file could be retrieved as an EndpointGroup using the following code:


 CentralDogmaEndpointGroup<JsonNode> endpointGroup = CentralDogmaEndpointGroup.of(
      centralDogma, "myProject", "myRepo",
      Query.ofJson("/endpoints.json"),
      EndpointListDecoder.JSON);
 endpointGroup.awaitInitialEndpoints();
 endpointGroup.endpoints();