use of org.apache.servicecomb.core.filter.FilterNode in project java-chassis by ServiceComb.
the class ProducerInvocationFlowTest method mockInvocationFailed.
private void mockInvocationFailed() {
filterNode = new FilterNode((_invocation, _node) -> {
throw new RuntimeExceptionWithoutStackTrace();
});
mockFilterChain();
}
use of org.apache.servicecomb.core.filter.FilterNode in project java-chassis by ServiceComb.
the class ProducerOperationFilter method onFilter.
@Override
public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) {
invocation.onBusinessMethodStart();
SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation();
Object instance = producerOperation.getProducerInstance();
Method method = producerOperation.getProducerMethod();
Object[] args = invocation.toProducerArguments();
return invoke(invocation, instance, method, args).thenApply(result -> convertResultToResponse(invocation, producerOperation, result)).whenComplete((response, throwable) -> processMetrics(invocation));
}
Aggregations