Commit 641d04de by 王召彬

解决发cmq消息重试的bug

parent 986a0aea
...@@ -259,9 +259,14 @@ class Topic ...@@ -259,9 +259,14 @@ class Topic
$tryTimes = 0; $tryTimes = 0;
do { do {
$res = $this->publish_message($cryptMessage, $vTagList, $routingKey); try {
$res = $this->publish_message($cryptMessage, $vTagList, $routingKey);
if($res['code'] == 0) break;
} catch(\Throwable $e) {
App::error("[消息队列异常]:".var_export($e, true));
}
$tryTimes++; $tryTimes++;
} while ($res['code'] != 0 && $tryTimes < 3); } while ($tryTimes < 3);
if ($tryTimes >= 3) { if ($tryTimes >= 3) {
App::error("[消息队列失败]:$message"); App::error("[消息队列失败]:$message");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment