现象描述
发送客服消息文本消息时,根据日志记录,软件在请求API接口时每一次都使用了新的access_token,而没有将其缓存起来重复使用。
同样测试了使用外部AccessToken勾选->通过接口获取的情况,问题也一致。
外部API页面获得的值案例:
{"access_token":"25_AeIuxNYnU5WsaJCzpgdDkDCGDOEkeR1AcvF_ScUfEafMUmQG0C685SEcikMowkIjDwtIqhr-bdC-wxE-hnOVX5Nx9DqJyIPHDryZAG15uA5hUKouXLee-ys_7La-Ann3uYjEFdzDyfkAY5ENHNDhAIAVBR","expires_in":720}
由于发送模板消息请求API的地址在日志中没有被记录,因此无法确定模板消息的发送是否也一样。
环境信息
windows 7 64位
jdk 1.8
重现步骤
- 步骤1,设置 -> 微信公众号->填写appid及appscreate
- 步骤2,新建消息、获取openid等操作
- 步骤3,发送客服消息
- 步骤4,发送模板消息
日志信息
【请求地址】: https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=25_2R5eUHdLNXTuGcyjK1pY-Q4BVBX89uk-HrlYkM8FmGeJNDj51kjcJMyZUVBV84hREhZPVcudABmXJSwCZpHtn5b0XIUXacSSGJN61a2FP1dt6SqW1H5tLqQGkXlLB3sqUBJDR9xWrLejiJXfHMFiADANSL
【请求参数】:{"touser":"okmq0t5eg-23MbwOxmdwq1ANv07A","msgtype":"text","text":{"content":"一条客服文本消息,<a href="https://www.baidu.com\">去百度\n\nCJNET"}}
【错误信息】:{"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [pq6u909944105]"}
15:16:33.932 [pool-4-thread-3] ERROR c.f.t.p.l.msgsender.WxKefuMsgSender :44 - me.chanjar.weixin.common.error.WxErrorException: {"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [pq6u909944105]"}
15:16:33.936 [pool-4-thread-3] WARN c.f.tool.push.util.ConsoleUtil :30 - T-2已处理完第2-3条的数据
15:16:34.136 [pool-4-thread-11] ERROR c.f.tool.push.util.WeWxMpServiceImpl :324 -
【请求地址】: https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=25_MFazl_i9Jg1Pgkq3K1pY-Q4BVBX89uk-HrlYkM8FmGeJNDj51kjcJMyZUVB_kv2_s0F-Y2qlvZKwcPR0eIGZkpnn89pTpoa5SWSiyk0p7AiO6BwrCXaT0Umh_5753yl-eVMANVByq2UUvoqYRHRiADAZPZ
【请求参数】:{"touser":"okmq0twwypbEw9yS-td7s5lra2vU","msgtype":"text","text":{"content":"一条客服文本消息,<a href="https://www.baidu.com\">去百度\n\nCJNET"}}
【错误信息】:{"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [XvIwFa09943114]"}
15:16:34.137 [pool-4-thread-11] ERROR c.f.t.p.l.msgsender.WxKefuMsgSender :44 - me.chanjar.weixin.common.error.WxErrorException: {"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [XvIwFa09943114]"}
15:16:34.138 [pool-4-thread-11] WARN c.f.tool.push.util.ConsoleUtil :30 - T-10已处理完第10-11条的数据
15:16:34.332 [pool-4-thread-10] ERROR c.f.tool.push.util.WeWxMpServiceImpl :324 -
【请求地址】: https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=25_oFEfwaZaNLEMRRjuK1pY-Q4BVBX89uk-HrlYkM8FmGeJNDj51kjcJMyZUVDBuDyan4ah2GGci9P5uFKWjqFKHkMoHBAepyF6D20K1EmR3ZHGsxs4R1A6KWsIFhurl6IjBB4i4jR-NCYA9q9BEHXiADAORH
【请求参数】:{"touser":"okmq0t36FiLuqoVIdM0lujnfh4W4","msgtype":"text","text":{"content":"一条客服文本消息,<a href="https://www.baidu.com\">去百度\n\nCJNET"}}
【错误信息】:{"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [BkwIgA09943929]"}
15:16:34.333 [pool-4-thread-10] ERROR c.f.t.p.l.msgsender.WxKefuMsgSender :44 - me.chanjar.weixin.common.error.WxErrorException: {"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [BkwIgA09943929]"}
15:16:34.334 [pool-4-thread-10] WARN c.f.tool.push.util.ConsoleUtil :30 - T-9已处理完第9-10条的数据
15:16:34.494 [pool-4-thread-2] ERROR c.f.tool.push.util.WeWxMpServiceImpl :324 -
【请求地址】: https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=25_mYBjWF4hSKpzIBwmK1pY-Q4BVBX89uk-HrlYkM8FmGeJNDj51kjcJMyZUVDYAuizz74kQ2yFhs1Se07l9tVisApG8etpQPiHkG9iRC7_VEUKb8jOLstoUWQ1zf7IA8F8TfE6OLaKZaSj6yOxYGWiADANVL
【请求参数】:{"touser":"okmq0t27Nvzp1nploE7oFynpEqMs","msgtype":"text","text":{"content":"一条客服文本消息,<a href="https://www.baidu.com\">去百度\n\nCJNET"}}
【错误信息】:{"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [B6ZruA09944119]"}
15:16:34.495 [pool-4-thread-2] ERROR c.f.t.p.l.msgsender.WxKefuMsgSender :44 - me.chanjar.weixin.common.error.WxErrorException: {"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [B6ZruA09944119]"}
15:16:34.496 [pool-4-thread-2] WARN c.f.tool.push.util.ConsoleUtil :30 - T-1已处理完第1-2条的数据
15:16:34.686 [pool-4-thread-6] ERROR c.f.tool.push.util.WeWxMpServiceImpl :324 -
【请求地址】: https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=25_9_amPqxG38nZOPB4w9Il7ljV6wUuOlkgWsHSvAbV7AibnmFeDKxABD83s7pWXW_GaMEhSUQiUR28duo974PC-FL08ZCOfwhRYOH7Do5MgEiUvB1uxj8ydsg9uQSvt3HvfmlZQeejdChfy6xMMNNhAAAFGG
【请求参数】:{"touser":"okmq0t2jha0MpsC6ahaMmjdIAuyw","msgtype":"text","text":{"content":"一条客服文本消息,<a href="https://www.baidu.com\">去百度\n\nCJNET"}}
【错误信息】:{"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [4QuNfA09953935]"}
15:16:34.687 [pool-4-thread-6] ERROR c.f.t.p.l.msgsender.WxKefuMsgSender :44 - me.chanjar.weixin.common.error.WxErrorException: {"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [4QuNfA09953935]"}
15:16:34.688 [pool-4-thread-6] WARN c.f.tool.push.util.ConsoleUtil :30 - T-5已处理完第5-6条的数据
15:16:34.902 [pool-4-thread-5] ERROR c.f.tool.push.util.WeWxMpServiceImpl :324 -
【请求地址】: https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=25_RUDkevDOgcec53drw9Il7ljV6wUuOlkgWsHSvAbV7AibnmFeDKxABD83s7rdvLkp_LwB5kmO1H97-OEpiwI0uH_VvqkYt3hUvl9rQxnBDXlpJx9KQ0OtPqVS6wCm6hMJvY2S3CPYO85VvvG5AGMhAAAQWC
【请求参数】:{"touser":"okmq0txGYoLcy_aN-29QWD0hdXVE","msgtype":"text","text":{"content":"一条客服文本消息,<a href="https://www.baidu.com\">去百度\n\nCJNET"}}
【错误信息】:{"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [XJbzIa09954963]"}
15:16:34.903 [pool-4-thread-5] ERROR c.f.t.p.l.msgsender.WxKefuMsgSender :44 - me.chanjar.weixin.common.error.WxErrorException: {"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [XJbzIa09954963]"}
15:16:34.904 [pool-4-thread-5] WARN c.f.tool.push.util.ConsoleUtil :30 - T-4已处理完第4-5条的数据
15:16:35.118 [pool-4-thread-7] ERROR c.f.tool.push.util.WeWxMpServiceImpl :324 -
【请求地址】: https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=25_Jb6jxNpwYgEaJjhrw9Il7ljV6wUuOlkgWsHSvAbV7AibnmFeDKxABD83s7rQsoWNLjXaNX-VWnG-Ki7eoIhBgBb2yN1WLegowr00p7Dxp-zj6CgTMKV4SQaf89oeevF8erLO6DuTA1bT_8juHENhAAAYVE
【请求参数】:{"touser":"okmq0t-lPwrsdJLzl3-83vqENGdY","msgtype":"text","text":{"content":"一条客服文本消息,<a href="https://www.baidu.com\">去百度\n\nCJNET"}}
【错误信息】:{"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [0t6aNA09953114]"}
15:16:35.118 [pool-4-thread-7] ERROR c.f.t.p.l.msgsender.WxKefuMsgSender :44 - me.chanjar.weixin.common.error.WxErrorException: {"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [0t6aNA09953114]"}
15:16:35.119 [pool-4-thread-7] WARN c.f.tool.push.util.ConsoleUtil :30 - T-6已处理完第6-7条的数据
15:16:35.329 [pool-4-thread-9] ERROR c.f.tool.push.util.WeWxMpServiceImpl :324 -
【请求地址】: https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=25__wk-3rFd9ug3hQ-Ww9Il7ljV6wUuOlkgWsHSvAbV7AibnmFeDKxABD83s7rdm7lmrmI8NRgQr3rQB_dkDrLOCVx-tN1-IEbVmf9PVWGixFJiMtp06pGOMCmES3wwrPRb4fy5WvxzfN8vKcTrXPOhAAAQIH
【请求参数】:{"touser":"okmq0t84B1vMqmjAWnkb7scT-QA8","msgtype":"text","text":{"content":"一条客服文本消息,<a href="https://www.baidu.com\">去百度\n\nCJNET"}}
【错误信息】:{"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [eYjc_09953949]"}
15:16:35.330 [pool-4-thread-9] ERROR c.f.t.p.l.msgsender.WxKefuMsgSender :44 - me.chanjar.weixin.common.error.WxErrorException: {"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [eYjc_09953949]"}
15:16:35.331 [pool-4-thread-9] WARN c.f.tool.push.util.ConsoleUtil :30 - T-8已处理完第8-9条的数据
15:16:35.564 [pool-4-thread-14] WARN c.f.tool.push.util.ConsoleUtil :30 - T-13已处理完第13-14条的数据
15:16:35.739 [pool-4-thread-13] ERROR c.f.tool.push.util.WeWxMpServiceImpl :324 -
【请求地址】: https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=25_TVUPzrih9ceWFFJ4w9Il7ljV6wUuOlkgWsHSvAbV7AibnmFeDKxABD83s7o8vPth5cucweQypDgE9YbAd5mXQS5kmkGCGwoVgwaS-3zQZtBjvL2yDIT-uJgja86IHlqKlOMdrjwkT6Jhw6v1MJLhAAAQNP
【请求参数】:{"touser":"okmq0twAPMx9u4tVIdT-iik2SAg0","msgtype":"text","text":{"content":"一条客服文本消息,<a href="https://www.baidu.com\">去百度\n\nCJNET"}}
【错误信息】:{"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [Mb.vBa09963935]"}
15:16:35.740 [pool-4-thread-13] ERROR c.f.t.p.l.msgsender.WxKefuMsgSender :44 - me.chanjar.weixin.common.error.WxErrorException: {"errcode":45015,"errmsg":"response out of time limit or subscription is canceled hint: [Mb.vBa09963935]"}
15:16:35.742 [pool-4-thread-13] WARN c.f.tool.push.util.ConsoleUtil :30 - T-12已处理完第12-13条的数据
15:16:35.864 [pool-4-thread-8] ERROR c.f.t.p.l.msgsender.WxKefuMsgSender :44 - me.chanjar.weixin.common.error.WxErrorException:
15:16:35.864 [pool-4-thread-12] ERROR c.f.t.p.l.msgsender.WxKefuMsgSender :44 - me.chanjar.weixin.common.error.WxErrorException:
15:16:35.866 [pool-4-thread-8] WARN c.f.tool.push.util.ConsoleUtil :30 - T-7已处理完第7-8条的数据
15:16:35.864 [pool-4-thread-4] ERROR c.f.t.p.l.msgsender.WxKefuMsgSender :44 - me.chanjar.weixin.common.error.WxErrorException:
15:16:35.866 [pool-4-thread-12] WARN c.f.tool.push.util.ConsoleUtil :30 - T-11已处理完第11-12条的数据
15:16:35.867 [pool-4-thread-4] WARN c.f.tool.push.util.ConsoleUtil :30 - T-3已处理完第3-4条的数据
15:16:35.993 [pool-4-thread-1] WARN c.f.tool.push.util.ConsoleUtil :30 - T-0已处理完第0-1条的数据
15:16:37.183 [pool-3-thread-5] WARN c.f.tool.push.util.ConsoleUtil :30 - 正在保存结果数据……
15:16:37.694 [pool-3-thread-5] WARN c.f.tool.push.util.ConsoleUtil :30 - 结果数据保存完毕!
15:23:34.025 [pool-3-thread-2] WARN c.f.tool.push.util.ConsoleUtil :30 - 关注该公众账号的总用户数:14
15:23:34.029 [pool-3-thread-2] WARN c.f.tool.push.util.ConsoleUtil :30 - 拉取的OPENID个数:14
15:23:34.086 [pool-3-thread-2] WARN c.f.tool.push.util.ConsoleUtil :30 - 拉取的OPENID个数:0
15:23:42.629 [pool-3-thread-1] WARN c.f.tool.push.util.ConsoleUtil :30 - 消息总数:14
15:23:42.630 [pool-3-thread-1] WARN c.f.tool.push.util.ConsoleUtil :30 - 可用处理器核心:4
15:23:42.636 [pool-3-thread-1] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程数:23
15:23:42.642 [pool-3-thread-1] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程池大小:100
15:23:42.674 [pool-3-thread-1] WARN c.f.tool.push.util.ConsoleUtil :30 - 推送开始……
15:23:42.682 [pool-4-thread-2] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程T-1负责处理第:1-2条数据
15:23:42.682 [pool-4-thread-14] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程T-13负责处理第:13-14条数据
15:23:42.684 [pool-4-thread-1] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程T-0负责处理第:0-1条数据
15:23:42.684 [pool-4-thread-4] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程T-3负责处理第:3-4条数据
15:23:42.682 [pool-4-thread-5] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程T-4负责处理第:4-5条数据
15:23:42.690 [pool-4-thread-11] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程T-10负责处理第:10-11条数据
15:23:42.683 [pool-4-thread-3] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程T-2负责处理第:2-3条数据
15:23:42.684 [pool-4-thread-6] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程T-5负责处理第:5-6条数据
15:23:42.685 [pool-4-thread-7] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程T-6负责处理第:6-7条数据
15:23:42.686 [pool-4-thread-8] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程T-7负责处理第:7-8条数据
15:23:42.687 [pool-4-thread-9] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程T-8负责处理第:8-9条数据
15:23:42.688 [pool-4-thread-12] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程T-11负责处理第:11-12条数据
15:23:42.689 [pool-4-thread-10] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程T-9负责处理第:9-10条数据
15:23:42.692 [pool-4-thread-13] WARN c.f.tool.push.util.ConsoleUtil :30 - 线程T-12负责处理第:12-13条数据
15:23:42.693 [pool-3-thread-1] WARN c.f.tool.push.util.ConsoleUtil :30 - 所有线程宝宝启动完毕……
15:23:43.338 [pool-4-thread-3] WARN c.f.tool.push.util.ConsoleUtil :30 - T-2已处理完第2-3条的数据
15:23:43.488 [pool-4-thread-14] WARN c.f.tool.push.util.ConsoleUtil :30 - T-13已处理完第13-14条的数据
15:23:43.781 [pool-4-thread-9] WARN c.f.tool.push.util.ConsoleUtil :30 - T-8已处理完第8-9条的数据
15:23:43.926 [pool-4-thread-6] WARN c.f.tool.push.util.ConsoleUtil :30 - T-5已处理完第5-6条的数据
15:23:44.168 [pool-4-thread-5] WARN c.f.tool.push.util.ConsoleUtil :30 - T-4已处理完第4-5条的数据
15:23:44.338 [pool-4-thread-1] WARN c.f.tool.push.util.ConsoleUtil :30 - T-0已处理完第0-1条的数据
15:23:44.548 [pool-4-thread-13] WARN c.f.tool.push.util.ConsoleUtil :30 - T-12已处理完第12-13条的数据
15:23:44.726 [pool-4-thread-10] WARN c.f.tool.push.util.ConsoleUtil :30 - T-9已处理完第9-10条的数据
15:23:44.923 [pool-4-thread-2] WARN c.f.tool.push.util.ConsoleUtil :30 - T-1已处理完第1-2条的数据
15:23:45.114 [pool-4-thread-11] WARN c.f.tool.push.util.ConsoleUtil :30 - T-10已处理完第10-11条的数据
15:23:45.210 [pool-4-thread-8] ERROR c.f.t.p.l.m.WxMpTemplateMsgSender :73 - me.chanjar.weixin.common.error.WxErrorException:
15:23:45.210 [pool-4-thread-12] ERROR c.f.t.p.l.m.WxMpTemplateMsgSender :73 - me.chanjar.weixin.common.error.WxErrorException:
15:23:45.210 [pool-4-thread-4] ERROR c.f.t.p.l.m.WxMpTemplateMsgSender :73 - me.chanjar.weixin.common.error.WxErrorException:
15:23:45.215 [pool-4-thread-8] WARN c.f.tool.push.util.ConsoleUtil :30 - T-7已处理完第7-8条的数据
15:23:45.215 [pool-4-thread-12] WARN c.f.tool.push.util.ConsoleUtil :30 - T-11已处理完第11-12条的数据
15:23:45.216 [pool-4-thread-4] WARN c.f.tool.push.util.ConsoleUtil :30 - T-3已处理完第3-4条的数据
15:23:45.307 [pool-4-thread-7] WARN c.f.tool.push.util.ConsoleUtil :30 - T-6已处理完第6-7条的数据
15:23:46.528 [pool-3-thread-1] WARN c.f.tool.push.util.ConsoleUtil :30 - 正在保存结果数据……
15:23:47.147 [pool-3-thread-1] WARN c.f.tool.push.util.ConsoleUtil :30 - 结果数据保存完毕!