Class XdsCentralDogmaBuilder
java.lang.Object
com.linecorp.centraldogma.client.AbstractCentralDogmaBuilder<XdsCentralDogmaBuilder>
com.linecorp.centraldogma.client.armeria.xds.XdsCentralDogmaBuilder
@UnstableApi
public final class XdsCentralDogmaBuilder
extends AbstractCentralDogmaBuilder<XdsCentralDogmaBuilder>
Builds a
CentralDogma
client based on an Armeria
HTTP client.
This client differs from ArmeriaCentralDogma
in that making requests is done in two phases.
-
An xDS request is made to xDS servers to fetch a
Listener
resource which represents how to connect toCentralDogma
servers. -
Actual
CentralDogma
client requests are made based on the watched Listener resource.
CentralDogma
is determined by the watched Listener
,
AbstractCentralDogmaBuilder.hosts()
and AbstractCentralDogmaBuilder.isUseTls()
apply to connecting to the bootstrap only.
However, because Armeria's xDS implementation isn't complete, the following parameters are applied
to both xDS and Central Dogma requests.
AbstractCentralDogmaBuilder.accessToken(String)
clientConfigurator(ArmeriaClientConfigurator)
clientFactory(ClientFactory)
Note that this module is considered experimental and subject to behavioral change.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionblockingTaskExecutor
(ScheduledExecutorService blockingTaskExecutor) Sets theScheduledExecutorService
dedicated to the execution of blocking tasks or invocations.build()
Returns a newly-createdCentralDogma
instance.clientConfigurator
(ArmeriaClientConfigurator clientConfigurator) Sets theArmeriaClientConfigurator
that will configure an underlying Armeria client which performs the actual socket I/O.clientFactory
(ClientFactory clientFactory) Sets theClientFactory
that will create an underlying Armeria client which performs the actual socket I/O.listenerName
(String listenerName) Sets the name of theListener
that should be requested to the xDS bootstrap servers.localClusterName
(String localClusterName) Sets the name of the local cluster name which this client will be located in.serviceZone
(String serviceZone) Sets the locality of where theCentralDogma
client will be running.Methods inherited from class com.linecorp.centraldogma.client.AbstractCentralDogmaBuilder
accessToken, accessToken, host, host, hosts, isUseTls, maxNumRetriesOnReplicationLag, maxNumRetriesOnReplicationLag, profile, profile, profile, profile, profileResources, profileResources, retryIntervalOnReplicationLag, retryIntervalOnReplicationLagMillis, retryIntervalOnReplicationLagMillis, selectedProfile, self, uri, useTls, useTls
-
Constructor Details
-
XdsCentralDogmaBuilder
public XdsCentralDogmaBuilder()
-
-
Method Details
-
listenerName
Sets the name of theListener
that should be requested to the xDS bootstrap servers. The default is "centraldogma-listener". -
serviceZone
Sets the locality of where theCentralDogma
client will be running. This may be used in applying zone aware routing and is analogous to service-zone. This value will be set toNode.getLocality()
in theBootstrap
. -
localClusterName
Sets the name of the local cluster name which this client will be located in. This may be used in applying zone aware routing and is analogous to service-cluster. This value will be set toClusterManager.getLocalClusterName()
in theBootstrap
. -
blockingTaskExecutor
Sets theScheduledExecutorService
dedicated to the execution of blocking tasks or invocations. If not set, the common pool is used. TheScheduledExecutorService
which will be used for scheduling the tasks related with automatic retries and invoking the callbacks for watched changes. -
clientConfigurator
Sets theArmeriaClientConfigurator
that will configure an underlying Armeria client which performs the actual socket I/O.Note that this doesn't affect the client making requests to the bootstrap servers.
-
clientFactory
Sets theClientFactory
that will create an underlying Armeria client which performs the actual socket I/O.Note that this doesn't affect the client making requests to the bootstrap servers.
-
build
Returns a newly-createdCentralDogma
instance.
-