Răsfoiți Sursa

cancelLimitBuyConsumer 不单独创建消费者

shizhongqi 4 luni în urmă
părinte
comite
86bcd54ad9
2 a modificat fișierele cu 3 adăugiri și 13 ștergeri
  1. 1 1
      biz-ghs/product/classes/ProductClass.php
  2. 2 12
      common/config/rabbitMQ.php

+ 1 - 1
biz-ghs/product/classes/ProductClass.php

@@ -2668,7 +2668,7 @@ class ProductClass extends BaseClass
                 'productId' => $productId,
                 'clearAt' => $clearAt,
             ];
-            $producer = Yii::$app->rabbitmq->getProducer('cancelLimitBuyProducer');
+            $producer = Yii::$app->rabbitmq->getProducer('stockProducer');
             $producer->publish($message, 'limitBuyDelayExchange', 'limitBuyDelayRoute', [
                 'delivery_mode' => 2,
                 'content_type' => 'application/octet-stream',

+ 2 - 12
common/config/rabbitMQ.php

@@ -145,11 +145,7 @@ $rabbitMQ = [
         [
             //跑腿下单生产者
             'name' => 'ptProducer',
-        ],
-        [
-            //取消限购生产者
-            'name' => 'cancelLimitBuyProducer',
-        ],
+        ]
     ],
 
     /**
@@ -168,6 +164,7 @@ $rabbitMQ = [
             'name' => 'stockConsumer',
             'callbacks' => [
                 'stockQueue' => '\common\components\rabbitmq\stockConsumer',
+                'limitBuyQueue' => '\common\components\rabbitmq\cancelLimitBuyConsumer',
             ]
         ],
         [
@@ -183,13 +180,6 @@ $rabbitMQ = [
             'callbacks' => [
                 'ptQueue' => '\common\components\rabbitmq\ptConsumer',
             ]
-        ],
-        [
-            //取消限购消费者
-            'name' => 'cancelLimitBuyConsumer',
-            'callbacks' => [
-                'limitBuyQueue' => '\common\components\rabbitmq\cancelLimitBuyConsumer',
-            ]
         ]
     ],
 ];