loemkie 4 周之前
父節點
當前提交
f042d973a5
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/main/java/com/qmrb/system/mq/PickCarProducer.java

+ 3 - 0
src/main/java/com/qmrb/system/mq/PickCarProducer.java

@@ -68,6 +68,9 @@ public class PickCarProducer {
         Message message = new Message(topic, tags, body.getBytes(RemotingHelper.DEFAULT_CHARSET));
         StopWatch stop = new StopWatch();
         stop.start();
+        if(producer == null){
+            defaultMQProducer();
+        }
         SendResult result = producer.send(message);
         log.info("发送响应:MsgId:" + result.getMsgId() + ",发送状态:" + result.getSendStatus());
         stop.stop();