is_published() ist TRUE while mosquitto says NO
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?
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.
Since MQTT v5 release there is a reason code in PUBACK for publish messages rejected by the broker (rc = 0x87). It should work, right?
Yes MQTT 5 does include an authorization failure code, but it doesn't appear to surface in on_publish() sadly.
Closing this as I believe the question has been answered (best to handle the v5 responses in a separate issue to keep things clean)