微信服务号调用批量推送接口,报大量-1和-6的错误?
https://api.weixin.qq.com/cgi-bin/message/mass/send?access_token=ACCESS_TOKEN
我们一分钟调用40~50次,每次传7000个openid,具体实现代码如下:
public static final String MESSAGE_MASS_SEND = “https://api.weixin.qq.com/cgi-bin/message/mass/send?access_token=%s”;
/**
* 发送单组推文消息
*/
public MessageMassSendResult massSend(String accessToken, MassSendRequestTO massSendTO) throws WechatException {
String massSendUrl = String.format(WechatUrlConstant.MESSAGE_MASS_SEND, accessToken);
MessageMassSend massSend = new MessageMassSend();
massSend.setToUser(massSendTO.getToUser());
Map<String, String> map = new HashMap<>();
map.put(“media_id”, massSendTO.getMediaId());
massSend.setMpnews(map);
massSend.setMsgType(WechatConstant.MASS_MSG_NEWS);
massSend.setSendIgnoreReprint(0);
logger.info(“mass send data,mediaid:[{}]”, massSendTO.getMediaId());
String result = WechatRequestHandler.handleHttpPost(massSendUrl, JSON.toJSONString(massSend));
logger.info(“mass send result:[{}]”, result, JSON.toJSONString(massSend));
MessageMassSendResult massSendResult = MessageMassSendResult.fromJson(result);
return massSendResult;
}
注:我们写了一个脚本,会调用massSend这个方法,接收到response之后,会再间隔一秒调用massSend方法,目前的问题是会出现大量-1和-6的系统报错,文档上只是笼统说了一下系统错误,请问具体是什么原因?