You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicecomb.apache.org by GitBox <gi...@apache.org> on 2017/12/27 04:35:07 UTC

[GitHub] zhengyangyong commented on a change in pull request #468: [SCB-126] Add Consumer side event trigger for collect metrics data

zhengyangyong commented on a change in pull request #468: [SCB-126] Add Consumer side event trigger for collect metrics data
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/468#discussion_r158761413
 
 

 ##########
 File path: transports/transport-highway/src/main/java/io/servicecomb/transport/highway/HighwayClient.java
 ##########
 @@ -100,22 +105,26 @@ public void send(Invocation invocation, AsyncResponse asyncResp) throws Exceptio
     tcpClientPool.send(tcpClient, clientPackage, ar -> {
       // ??????????????
       invocation.getResponseExecutor().execute(() -> {
-        if (ar.failed()) {
-          // ???????
-          asyncResp.consumerFail(ar.cause());
-          return;
-        }
-
-        // ????
         try {
-          Response response =
-              HighwayCodec.decodeResponse(invocation,
-                  operationProtobuf,
-                  ar.result(),
-                  tcpClient.getProtobufFeature());
-          asyncResp.complete(response);
-        } catch (Throwable e) {
-          asyncResp.consumerFail(e);
+          if (ar.failed()) {
+            // ???????
+            asyncResp.consumerFail(ar.cause());
+            return;
+          }
+
+          // ????
+          try {
+            Response response =
+                HighwayCodec.decodeResponse(invocation,
+                    operationProtobuf,
+                    ar.result(),
+                    tcpClient.getProtobufFeature());
+            asyncResp.complete(response);
+          } catch (Throwable e) {
+            asyncResp.consumerFail(e);
+          }
+        } finally {
+          invocation.triggerFinishedEvent();
 
 Review comment:
   response complete code is written by user, i seems difficult to separate

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services