From 6d6f93cdee218cbc08cea184e3d508eaf2838415 Mon Sep 17 00:00:00 2001 From: snoop Date: Fri, 30 Jun 2017 15:04:40 +0900 Subject: [PATCH] fixed servcice Proxy --- .../java/com/loafle/overflow/proxy/ServiceProxy.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/loafle/overflow/proxy/ServiceProxy.java b/src/main/java/com/loafle/overflow/proxy/ServiceProxy.java index c097edc..a805e84 100644 --- a/src/main/java/com/loafle/overflow/proxy/ServiceProxy.java +++ b/src/main/java/com/loafle/overflow/proxy/ServiceProxy.java @@ -67,6 +67,12 @@ public class ServiceProxy { String result = null; try { result =this.serviceInvoker.invokeForByteString(request.getTarget(), request.getMethod(), request.getParamsList().asByteStringList()); + + ServerOutput reply = ServerOutput.newBuilder() + .setResult(result) + .build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); } catch (NoSuchMethodException e) { e.printStackTrace(); responseObserver.onError(e); @@ -83,11 +89,7 @@ public class ServiceProxy { e.printStackTrace(); responseObserver.onError(e); } - ServerOutput reply = ServerOutput.newBuilder() - .setResult(result) - .build(); - responseObserver.onNext(reply); - responseObserver.onCompleted(); + // String targetServiceName = request.getTarget(); // Object service = ctx.getBean(targetServiceName);