publish return code always 0, even if failure with access denied in restricted topic
I would like to detect if a publish message has been sent or rejected by the broker when restricting access with ACL.
expected: return code 135 if access denied
as-is: return code is always 0 - even if the message is not published by the broker because of ACL denial.
I am using mqtt v5 and qos1,
properties=Properties(PacketTypes.PUBLISH)
properties.MessageExpiryInterval=5 # retain messages for x seconds
ret = self.__mqtt_client.publish(restricted_data, payload, retain=1, qos=1, properties=properties)
ret.wait_for_publish()
print(ret.is_published()) # always True
print (f" RET={ret.rc}") # always 0
Tested with nodejs mqtt library, and saw an authorization error - so the broker works as expected.
oh, there is already a pull request! https://github.com/eclipse/paho.mqtt.python/pull/656 please merge, this is very necessary
Hi. I am also experiencing a similar situation. The return code of the publish function is always 0, even if the topic does not exist. I reinforce that this correction is very necessary.
Hi, would just like to reiterate that this is feature is critical for QOS 2 applications. Please fix soon!
Same here! hopefully, it will be resolved soon. I'll be watching 👀
This is a critical bug that is forcing us to verify manually what should be an automated process.
We have the same issue, please merge / release a fix soon!
Hi we are getting the issue issue. It's important to us. Please merge it soon!