Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

开放平台WxOpenServiceAbstractImpl.Executor() synchronized严重影响系统吞吐量 #1424

Closed
ZTielong opened this issue Mar 3, 2020 · 3 comments

Comments

@ZTielong
Copy link

ZTielong commented Mar 3, 2020

系统对微信的请求依赖本出口,微信接口响应慢,用户流量高峰时,系统锁等待导致线程池耗尽,应用雪崩。
protected synchronized <T, E> T execute(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException {
try {
T result = executor.execute(uri, data);
this.log.debug("\n【请求地址】: {}\n【请求参数】:{}\n【响应数据】:{}", uri, data, result);
return result;
} catch (WxErrorException e) {
WxError error = e.getError();
if (error.getErrorCode() != 0) {
this.log.error("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uri, data, error);
throw new WxErrorException(error, e);
}
return null;
} catch (IOException e) {
this.log.error("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uri, data, e.getMessage());
throw new RuntimeException(e);
}
}

@binarywang
Copy link
Member

楼主有什么好的改进办法没?

@binarywang
Copy link
Member

@007gzs 有什么想法没?

007gzs added a commit to 007gzs/weixin-java-tools that referenced this issue Apr 4, 2020
@binarywang
Copy link
Member

3.7.5.B 测试版本已优化

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants