mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-21 11:07:37 +08:00
#947 修复WxCpMessageRouter同时存在两个StandardSessionManager的问题
This commit is contained in:
@@ -165,6 +165,13 @@ public interface WxCpService {
|
|||||||
*/
|
*/
|
||||||
WxSession getSession(String id, boolean create);
|
WxSession getSession(String id, boolean create);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取WxSessionManager 对象
|
||||||
|
*
|
||||||
|
* @return WxSessionManager
|
||||||
|
*/
|
||||||
|
WxSessionManager getSessionManager();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 设置WxSessionManager,只有当需要使用个性化的WxSessionManager的时候才需要调用此方法,
|
* 设置WxSessionManager,只有当需要使用个性化的WxSessionManager的时候才需要调用此方法,
|
||||||
|
@@ -285,6 +285,11 @@ public abstract class BaseWxCpServiceImpl<H, P> implements WxCpService, RequestH
|
|||||||
this.sessionManager = sessionManager;
|
this.sessionManager = sessionManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WxSessionManager getSessionManager() {
|
||||||
|
return this.sessionManager;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String replaceParty(String mediaId) throws WxErrorException {
|
public String replaceParty(String mediaId) throws WxErrorException {
|
||||||
String url = "https://qyapi.weixin.qq.com/cgi-bin/batch/replaceparty";
|
String url = "https://qyapi.weixin.qq.com/cgi-bin/batch/replaceparty";
|
||||||
|
@@ -73,7 +73,7 @@ public class WxCpMessageRouter {
|
|||||||
this.wxCpService = wxCpService;
|
this.wxCpService = wxCpService;
|
||||||
this.executorService = Executors.newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE);
|
this.executorService = Executors.newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE);
|
||||||
this.messageDuplicateChecker = new WxMessageInMemoryDuplicateChecker();
|
this.messageDuplicateChecker = new WxMessageInMemoryDuplicateChecker();
|
||||||
this.sessionManager = new StandardSessionManager();
|
this.sessionManager = wxCpService.getSessionManager();
|
||||||
this.exceptionHandler = new LogExceptionHandler();
|
this.exceptionHandler = new LogExceptionHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user