shish 8 luni în urmă
părinte
comite
c700fe4d08

+ 3 - 4
common/components/rabbitmq/customConsumer.php

@@ -6,6 +6,7 @@
 
 namespace common\components\rabbitmq;
 
+use common\components\noticeUtil;
 use mikemadisonweb\rabbitmq\components\ConsumerInterface;
 use PhpAmqpLib\Message\AMQPMessage;
 use Yii;
@@ -28,12 +29,10 @@ class customConsumer implements ConsumerInterface
             // 反序列化消息体
             $data = unserialize($msg->body);
             if (!is_array($data)) {
-                Yii::error("Invalid custom message format: {$msg->body}", 'rabbitmq.custom');
+                noticeUtil::push("客户的消费者报错:Invalid notify message format: {$msg->body}", '15280215347');
                 return ConsumerInterface::MSG_REJECT;
             }
-            
-            Yii::info("Processing custom message: " . json_encode($data), 'rabbitmq.custom');
-            
+            //print_r($data);
             // 根据操作类型分发处理
             $action = $data['action'] ?? null;
             switch ($action) {

+ 3 - 5
common/components/rabbitmq/stockConsumer.php

@@ -6,6 +6,7 @@
 
 namespace common\components\rabbitmq;
 
+use common\components\noticeUtil;
 use mikemadisonweb\rabbitmq\components\ConsumerInterface;
 use PhpAmqpLib\Message\AMQPMessage;
 use Yii;
@@ -27,14 +28,11 @@ class stockConsumer implements ConsumerInterface
         try {
             // 反序列化消息体
             $data = unserialize($msg->body);
-            
             if (!is_array($data)) {
-                Yii::error("Invalid stock message format: {$msg->body}", 'rabbitmq.stock');
+                noticeUtil::push("库存的消费者报错:Invalid notify message format: {$msg->body}", '15280215347');
                 return ConsumerInterface::MSG_REJECT;
             }
-            
-            Yii::info("Processing stock message: " . json_encode($data), 'rabbitmq.stock');
-            
+            //print_r($data);
             // 根据操作类型分发处理
             $action = $data['action'] ?? null;
             switch ($action) {