feat:新增消费端类型

This commit is contained in:
zyimm 2023-08-03 09:52:25 +08:00
parent bb97aa14fb
commit a7da13c585

View File

@ -12,6 +12,8 @@ use tm\xls\rocketMq\thinkphp\connection\Connection;
class Producer
{
const TYPE = 1;
private $connection;
public function __construct(Connection $connection)
@ -74,6 +76,7 @@ class Producer
$data['backUrl'] = $this->connection->config->getBackUrl();
$data['messageBody'] = $data['body'] ?? '';
$data['messageBody'] = json_encode($data['messageBody']);
$data['consumerType'] = static::TYPE;
unset($data['body']);
return $data;
}