php-mqtt/client

RETAIN flag is always FALSE on subscribing Messages.

reinweb opened this issue · 1 comments

RETAIN always FALSE on subscribing Messages.

Version 1.8.1.
Using the provided example "/client-examples/02_subscribing/01_subscribe_with_qos_0.php".
Line 24ff:
$client->subscribe('foo/bar/baz', function (string $topic, string $message, bool $retained) use ($logger, $client) {
--> the variable $retained is always "false".

Maybe the reason can be found here (as rayrola mentioned on Sep 1)
MqttClient.php:775 deliverPublishedMessage.
and
`MqttClient.php:760 "false"

the tool mosquitto_sub shows the correct retain flag:
mosquitto_sub -u xxx -P xxx -t 'xxxx#' -k 20 -h xxxx --verbose -F '%j' -d --nodelay -q 0 --pretty

Let's close this in favour of #163.