From ff5d7f4e3cecd594f4db90e2cfde243ab61ac42c Mon Sep 17 00:00:00 2001 From: zyimm Date: Thu, 17 Aug 2023 14:24:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=B6=88=E6=81=AFid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/consumer/Consumer.php | 1 + src/consumer/message/Message.php | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/consumer/Consumer.php b/src/consumer/Consumer.php index a43fcfa..3c2a3b2 100644 --- a/src/consumer/Consumer.php +++ b/src/consumer/Consumer.php @@ -18,6 +18,7 @@ class Consumer $this->message->setMessageBody($data['messageBody'] ?? ''); $this->message->setTopic($data['topic'] ?? ''); $this->message->setTag($data['tag'] ?? ''); + $this->message->setMessageId($data['messageId'] ?? ''); } diff --git a/src/consumer/message/Message.php b/src/consumer/message/Message.php index 7d6ab03..6ec9b36 100644 --- a/src/consumer/message/Message.php +++ b/src/consumer/message/Message.php @@ -4,6 +4,7 @@ namespace tm\xls\rocketMq\thinkphp\consumer\message; class Message { + private $messageId; private $messageBody; private $tag; @@ -57,4 +58,20 @@ class Message { $this->topic = $topic; } + + /** + * @return mixed + */ + public function getMessageId() + { + return $this->messageId; + } + + /** + * @param string $messageId + */ + public function setMessageId(string $messageId): void + { + $this->messageId = $messageId; + } } \ No newline at end of file