immusen/yii2-swoole-mqtt

can sub multiple topic in one request?

luxiongwei opened this issue · 1 comments

like this

$topics = [
'room/sub/100001' => array("qos" => 1, "function" => "procmsg"),
'client/sub/100001' => array("qos" => 1, "function" => "procmsg")
];
$mqtt->subscribe($topics, 1);

Not yet supported, I will update to add this feature If you need..
But subscribe not have payload/message field, Just Topic + Request Qos, So the your sample code may not get expect result.

Multi topic subscribe package body:

Field value
Topic Name “a/b”
Requested QoS 0x01
Topic Name “c/d”
Requested QoS 0x02