use of org.apache.servicecomb.foundation.vertx.http.VertxClientResponseToHttpServletResponse in project java-chassis by ServiceComb.
the class RestClientInvocation method processResponseBody.
/**
* after this method, connection will be recycled to connection pool
* @param responseBuf response body buffer, when download, responseBuf is null, because download data by ReadStreamPart
*/
protected void processResponseBody(Buffer responseBuf) {
invocation.getInvocationStageTrace().finishReceiveResponse();
invocation.getResponseExecutor().execute(() -> {
try {
invocation.getInvocationStageTrace().startClientFiltersResponse();
HttpServletResponseEx responseEx = new VertxClientResponseToHttpServletResponse(clientResponse, responseBuf);
for (HttpClientFilter filter : httpClientFilters) {
if (filter.enabled()) {
Response response = filter.afterReceiveResponse(invocation, responseEx);
if (response != null) {
complete(response);
return;
}
}
}
} catch (Throwable e) {
fail(e);
}
});
}
Aggregations