Skip to content

Commit

Permalink
1.2.3版本, 代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
naivetoby committed Jun 25, 2020
1 parent f6591ce commit 58749a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/vip/toby/rpc/client/RpcClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ public Object invoke(Object proxy, Method method, Object[] args) {
String paramDataJsonString = paramData.toJSONString();
try {
if (this.rpcType == RpcType.ASYNC) {
sender.convertAndSend(paramDataJsonString);
this.sender.convertAndSend(paramDataJsonString);
LOGGER.debug(this.rpcType.getName() + "-RpcClient-" + this.rpcName + ", Method: " + methodName + " Call Success, Param: " + paramDataJsonString);
return null;
}
// 发起请求并返回结果
long start = System.currentTimeMillis();
Object resultObj = sender.convertSendAndReceive(paramDataJsonString);
Object resultObj = this.sender.convertSendAndReceive(paramDataJsonString);
if (resultObj == null) {
// 无返回任何结果,说明服务器负载过高,没有及时处理请求,导致超时
LOGGER.error("Duration: " + (System.currentTimeMillis() - start) + "ms, " + this.rpcType.getName() + "-RpcClient-" + this.rpcName + ", Method: " + methodName + " Service Unavailable, Param: " + paramDataJsonString);
Expand Down

0 comments on commit 58749a6

Please sign in to comment.