Search in sources :

Example 1 with VertxHttpMethod

use of io.servicecomb.transport.rest.client.http.VertxHttpMethod in project java-chassis by ServiceComb.

the class RestTransportClient method send.

public void send(Invocation invocation, AsyncResponse asyncResp) throws Exception {
    HttpClientWithContext httpClientWithContext = clientMgr.findThreadBindClientPool();
    OperationMeta operationMeta = invocation.getOperationMeta();
    RestOperationMeta swaggerRestOperation = operationMeta.getExtData(RestConst.SWAGGER_REST_OPERATION);
    String method = swaggerRestOperation.getHttpMethod();
    try {
        VertxHttpMethod httpMethod = HttpMethodFactory.findHttpMethodInstance(method);
        httpMethod.doMethod(httpClientWithContext, invocation, asyncResp);
    } catch (Exception e) {
        asyncResp.fail(invocation.getInvocationType(), e);
        LOGGER.error("vertx rest transport send error.", e);
    }
}
Also used : RestOperationMeta(io.servicecomb.common.rest.definition.RestOperationMeta) VertxHttpMethod(io.servicecomb.transport.rest.client.http.VertxHttpMethod) HttpClientWithContext(io.servicecomb.foundation.vertx.client.http.HttpClientWithContext) OperationMeta(io.servicecomb.core.definition.OperationMeta) RestOperationMeta(io.servicecomb.common.rest.definition.RestOperationMeta)

Aggregations

RestOperationMeta (io.servicecomb.common.rest.definition.RestOperationMeta)1 OperationMeta (io.servicecomb.core.definition.OperationMeta)1 HttpClientWithContext (io.servicecomb.foundation.vertx.client.http.HttpClientWithContext)1 VertxHttpMethod (io.servicecomb.transport.rest.client.http.VertxHttpMethod)1