#947 修复WxCpMessageRouter同时存在两个StandardSessionManager的问题

This commit is contained in:
shilianwang
2019-03-01 15:00:56 +08:00
committed by Binary Wang
parent 1e23b3b743
commit 28affd2d11
3 changed files with 13 additions and 1 deletions

View File

@@ -165,6 +165,13 @@ public interface WxCpService {
*/
WxSession getSession(String id, boolean create);
/**
* 获取WxSessionManager 对象
*
* @return WxSessionManager
*/
WxSessionManager getSessionManager();
/**
* <pre>
* 设置WxSessionManager只有当需要使用个性化的WxSessionManager的时候才需要调用此方法

View File

@@ -285,6 +285,11 @@ public abstract class BaseWxCpServiceImpl<H, P> implements WxCpService, RequestH
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";

View File

@@ -73,7 +73,7 @@ public class WxCpMessageRouter {
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();
}