We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
在企微第三方回调接口使用消息路由时发现,当加好友回调消息的创建时间一样,但外部联系人不同,企微用户也不同时会被判断为重复消息,导致没有进入到后续的handle,造成该客户的相关业务未能处理。
Class: me.chanjar.weixin.cp.tp.message.WxCpTpMessageRouter Mehtod: isMsgDuplicated() `private boolean isMsgDuplicated(WxCpTpXmlMessage wxMessage) { StringBuilder messageId = new StringBuilder(); if (wxMessage.getInfoType() != null) { messageId.append(wxMessage.getInfoType()) .append("-").append(StringUtils.trimToEmpty(wxMessage.getSuiteId())) .append("-").append(wxMessage.getTimeStamp()) .append("-").append(StringUtils.trimToEmpty(wxMessage.getAuthCorpId())) .append("-").append(StringUtils.trimToEmpty(wxMessage.getUserID())) .append("-").append(StringUtils.trimToEmpty(wxMessage.getChangeType())) .append("-").append(StringUtils.trimToEmpty(wxMessage.getServiceCorpId())) .append("-").append(StringUtils.trimToEmpty(wxMessage.getExternalUserID())); }
if (wxMessage.getMsgType() != null) { if (wxMessage.getMsgId() != null) { messageId.append(wxMessage.getMsgId()) .append("-").append(wxMessage.getCreateTime()) .append("-").append(wxMessage.getFromUserName()); } else { messageId.append(wxMessage.getMsgType()) .append("-").append(wxMessage.getCreateTime()) .append("-").append(wxMessage.getFromUserName()) .append("-").append(StringUtils.trimToEmpty(wxMessage.getEvent())) .append("-").append(StringUtils.trimToEmpty(wxMessage.getEventKey())); } } return this.messageDuplicateChecker.isDuplicate(messageId.toString());
}`
在加好友回调中,InfoType为空,MsgID为空会进入到如图所示的逻辑中,此处createTime和FromUserName是相同的,而Event必定也是相同的,eventKey为空。所以会判定为重复消息,此处的messageId应加上ExternalUserID和userID作为唯一判定的key。
The text was updated successfully, but these errors were encountered:
@binarywang
Sorry, something went wrong.
可以加上,欢迎直接提交PR修复代码
No branches or pull requests
简要描述
在企微第三方回调接口使用消息路由时发现,当加好友回调消息的创建时间一样,但外部联系人不同,企微用户也不同时会被判断为重复消息,导致没有进入到后续的handle,造成该客户的相关业务未能处理。
模块版本情况
详细描述
Class: me.chanjar.weixin.cp.tp.message.WxCpTpMessageRouter
Mehtod: isMsgDuplicated()
`private boolean isMsgDuplicated(WxCpTpXmlMessage wxMessage) {
StringBuilder messageId = new StringBuilder();
if (wxMessage.getInfoType() != null) {
messageId.append(wxMessage.getInfoType())
.append("-").append(StringUtils.trimToEmpty(wxMessage.getSuiteId()))
.append("-").append(wxMessage.getTimeStamp())
.append("-").append(StringUtils.trimToEmpty(wxMessage.getAuthCorpId()))
.append("-").append(StringUtils.trimToEmpty(wxMessage.getUserID()))
.append("-").append(StringUtils.trimToEmpty(wxMessage.getChangeType()))
.append("-").append(StringUtils.trimToEmpty(wxMessage.getServiceCorpId()))
.append("-").append(StringUtils.trimToEmpty(wxMessage.getExternalUserID()));
}
}`
在加好友回调中,InfoType为空,MsgID为空会进入到如图所示的逻辑中,此处createTime和FromUserName是相同的,而Event必定也是相同的,eventKey为空。所以会判定为重复消息,此处的messageId应加上ExternalUserID和userID作为唯一判定的key。
The text was updated successfully, but these errors were encountered: