Search in sources :

Example 6 with SimpleJsonObject

use of org.apache.servicecomb.foundation.vertx.SimpleJsonObject in project java-chassis by ServiceComb.

the class VertxRestTransport method init.

@Override
public boolean init() throws Exception {
    restClient = RestTransportClientManager.INSTANCE.getRestClient();
    // 部署transport server
    DeploymentOptions options = new DeploymentOptions().setInstances(TransportConfig.getThreadCount());
    SimpleJsonObject json = new SimpleJsonObject();
    json.put(ENDPOINT_KEY, getEndpoint());
    json.put(RestTransportClient.class.getName(), restClient);
    options.setConfig(json);
    options.setWorkerPoolName("pool-worker-transport-rest");
    options.setWorkerPoolSize(VertxOptions.DEFAULT_WORKER_POOL_SIZE);
    prepareBlockResource();
    return VertxUtils.blockDeploy(transportVertx, TransportConfig.getRestServerVerticle(), options);
}
Also used : RestTransportClient(org.apache.servicecomb.transport.rest.client.RestTransportClient) DeploymentOptions(io.vertx.core.DeploymentOptions) SimpleJsonObject(org.apache.servicecomb.foundation.vertx.SimpleJsonObject)

Aggregations

SimpleJsonObject (org.apache.servicecomb.foundation.vertx.SimpleJsonObject)6 DeploymentOptions (io.vertx.core.DeploymentOptions)4 JsonObject (io.vertx.core.json.JsonObject)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 Expectations (mockit.Expectations)2 Mock (mockit.Mock)2 HttpClientWithContext (org.apache.servicecomb.foundation.vertx.client.http.HttpClientWithContext)2 Test (org.junit.Test)2 Context (io.vertx.core.Context)1 RestTransportClient (org.apache.servicecomb.transport.rest.client.RestTransportClient)1