Skip to content

Commit

Permalink
#947 修复WxCpMessageRouter同时存在两个StandardSessionManager的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
shilianwang authored and binarywang committed Mar 1, 2019
1 parent 1e23b3b commit 28affd2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ public interface WxCpService {
*/
WxSession getSession(String id, boolean create);

/**
* 获取WxSessionManager 对象
*
* @return WxSessionManager
*/
WxSessionManager getSessionManager();

/**
* <pre>
* 设置WxSessionManager,只有当需要使用个性化的WxSessionManager的时候才需要调用此方法,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ public void setSessionManager(WxSessionManager sessionManager) {
this.sessionManager = sessionManager;
}

@Override
public WxSessionManager getSessionManager() {
return this.sessionManager;
}

@Override
public String replaceParty(String mediaId) throws WxErrorException {
String url = "https://qyapi.weixin.qq.com/cgi-bin/batch/replaceparty";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public WxCpMessageRouter(WxCpService wxCpService) {
this.wxCpService = wxCpService;
this.executorService = Executors.newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE);
this.messageDuplicateChecker = new WxMessageInMemoryDuplicateChecker();
this.sessionManager = new StandardSessionManager();
this.sessionManager = wxCpService.getSessionManager();
this.exceptionHandler = new LogExceptionHandler();
}

Expand Down

0 comments on commit 28affd2

Please sign in to comment.