use of io.vertx.core.DeploymentOptions in project java-chassis by ServiceComb.
the class AbstractClientPool method create.
public void create() {
// 这里面是同步接口,且好像直接在事件线程中用,保险起见,先使用独立的vertx实例
Vertx vertx = VertxUtils.getOrCreateVertxByName("registry", null);
HttpClientOptions httpClientOptions = createHttpClientOptions();
DeploymentOptions deployOptions = VertxUtils.createClientDeployOptions(this.clientMgr, ServiceRegistryConfig.INSTANCE.getWorkerPoolSize(), 1, httpClientOptions);
try {
VertxUtils.blockDeploy(vertx, HttpClientVerticle.class, deployOptions);
} catch (InterruptedException e) {
LOGGER.error("deploy a registry verticle failed, {}", e.getMessage());
}
}
use of io.vertx.core.DeploymentOptions in project java-chassis by ServiceComb.
the class RestTransportClient method init.
public void init(Vertx vertx) throws Exception {
HttpClientOptions httpClientOptions = createHttpClientOptions();
DeploymentOptions deployOptions = VertxUtils.createClientDeployOptions(clientMgr, TransportClientConfig.getThreadCount(), TransportClientConfig.getConnectionPoolPerThread(), httpClientOptions);
VertxUtils.blockDeploy(vertx, HttpClientVerticle.class, deployOptions);
}
use of io.vertx.core.DeploymentOptions in project java-chassis by ServiceComb.
the class GrpcTransport method init.
public boolean init() throws Exception {
GrpcCodec.setGrpcTransport(this);
HttpClientOptions httpClientOptions = createHttpClientOptions();
DeploymentOptions deployOptions = VertxUtils.createClientDeployOptions(clientMgr, GrpcConfig.getThreadCount(), GrpcConfig.getConnectionPoolPerThread(), httpClientOptions);
setListenAddressWithoutSchema(GrpcConfig.getAddress());
// config already initialized by createClientDeployOptions
deployOptions.getConfig().put(ENDPOINT_KEY, getEndpoint().getEndpoint());
return VertxUtils.blockDeploy(transportVertx, GrpcVerticle.class, deployOptions);
}
Aggregations