paho.mqtt.python icon indicating copy to clipboard operation
paho.mqtt.python copied to clipboard

is_published() ist TRUE while mosquitto says NO

Open mhechthz opened this issue 5 years ago • 2 comments

Hi,

I have a ACL configured for mosquitto and now try to publish on a blocked topic.

While mosquitto displays:

1584022491: Denied PUBLISH from notAllowedClientTopic (d0, q1, r0, m11, 'test/pressur
e   ', ... (12 bytes))
1584022491: Sending PUBACK to notAllowedClientTopic (m11, rc135)

the client is_published() gives TRUE.

What's wrong here?

mhechthz avatar Mar 12 '20 14:03 mhechthz

is_published() means that it has been delivered to the broker, it doesn't have any information about whether it was denied or not. It is only possible to know whether a message has been rejected by the broker under MQTT v5 as well. It would certainly be useful to have that information where possible though.

ralight avatar Aug 07 '20 14:08 ralight

Since MQTT v5 release there is a reason code in PUBACK for publish messages rejected by the broker (rc = 0x87). It should work, right?

tarekasishm avatar Nov 18 '21 06:11 tarekasishm

Yes MQTT 5 does include an authorization failure code, but it doesn't appear to surface in on_publish() sadly.

SimonMacIntyre avatar Sep 11 '23 20:09 SimonMacIntyre

Closing this as I believe the question has been answered (best to handle the v5 responses in a separate issue to keep things clean)

MattBrittan avatar Dec 24 '23 00:12 MattBrittan