use of org.apache.servicecomb.foundation.vertx.client.http.HttpClientPoolFactory in project incubator-servicecomb-java-chassis by apache.
the class AbstractClientPool method create.
public void create() {
// 这里面是同步接口,且好像直接在事件线程中用,保险起见,先使用独立的vertx实例
VertxOptions vertxOptions = new VertxOptions();
vertxOptions.setAddressResolverOptions(AddressResolverConfig.getAddressResover(SSL_KEY));
Vertx vertx = VertxUtils.getOrCreateVertxByName("registry", vertxOptions);
HttpClientOptions httpClientOptions = createHttpClientOptions();
clientMgr = new ClientPoolManager<>(vertx, new HttpClientPoolFactory(httpClientOptions));
DeploymentOptions deployOptions = VertxUtils.createClientDeployOptions(this.clientMgr, ServiceRegistryConfig.INSTANCE.getWorkerPoolSize());
try {
VertxUtils.blockDeploy(vertx, ClientVerticle.class, deployOptions);
} catch (InterruptedException e) {
LOGGER.error("deploy a registry verticle failed, {}", e.getMessage());
}
}
use of org.apache.servicecomb.foundation.vertx.client.http.HttpClientPoolFactory in project incubator-servicecomb-java-chassis by apache.
the class RestTransportClient method init.
public void init(Vertx vertx) throws Exception {
HttpClientOptions httpClientOptions = createHttpClientOptions();
clientMgr = new ClientPoolManager<>(vertx, new HttpClientPoolFactory(httpClientOptions));
DeploymentOptions deployOptions = VertxUtils.createClientDeployOptions(clientMgr, TransportClientConfig.getThreadCount());
VertxUtils.blockDeploy(vertx, ClientVerticle.class, deployOptions);
}
use of org.apache.servicecomb.foundation.vertx.client.http.HttpClientPoolFactory in project incubator-servicecomb-java-chassis by apache.
the class ConfigCenterClient method deployConfigClient.
private void deployConfigClient() throws InterruptedException {
VertxOptions vertxOptions = new VertxOptions();
vertxOptions.setAddressResolverOptions(AddressResolverConfig.getAddressResover(SSL_KEY, ConfigCenterConfig.INSTANCE.getConcurrentCompositeConfiguration()));
Vertx vertx = VertxUtils.getOrCreateVertxByName("config-center", vertxOptions);
HttpClientOptions httpClientOptions = createHttpClientOptions();
clientMgr = new ClientPoolManager<>(vertx, new HttpClientPoolFactory(httpClientOptions));
DeploymentOptions deployOptions = VertxUtils.createClientDeployOptions(clientMgr, 1);
VertxUtils.blockDeploy(vertx, ClientVerticle.class, deployOptions);
}
use of org.apache.servicecomb.foundation.vertx.client.http.HttpClientPoolFactory in project java-chassis by ServiceComb.
the class DefaultMonitorDataPublisher method deployMonitorClient.
private void deployMonitorClient() throws InterruptedException {
VertxOptions vertxOptions = new VertxOptions();
vertxOptions.setAddressResolverOptions(AddressResolverConfig.getAddressResover(SSL_KEY));
Vertx vertx = VertxUtils.getOrCreateVertxByName("monitor-center", vertxOptions);
HttpClientOptions httpClientOptions = createHttpClientOptions();
httpClientOptions.setMaxWaitQueueSize(MAX_WAIT_QUEUE_SIZE);
clientMgr = new ClientPoolManager<>(vertx, new HttpClientPoolFactory(httpClientOptions));
DeploymentOptions deploymentOptions = VertxUtils.createClientDeployOptions(clientMgr, 1);
VertxUtils.blockDeploy(vertx, ClientVerticle.class, deploymentOptions);
}
Aggregations