emqx / CocoaMQTT

MQTT 5.0 client library for iOS and macOS written in Swift
https://www.emqx.com/en
Other
1.57k stars 411 forks source link

[Information] Is there a way to forcibly clear the message queue? #591

Closed skidnight closed 1 month ago

skidnight commented 1 month ago

I'm experiencing issues where messages can be buffered using qos0 with DUP and retained both set to false as follows:

mClient.publish(self.messageTopic, withString: jsonString!, qos: .qos0, DUP: false, retained: false, properties: publishProperties)

Publish properties are set as follows:

                let publishProperties = MqttPublishProperties()
                publishProperties.contentType = "JSON"
                publishProperties.messageExpiryInterval = 5;

So my question is, should this be happening and further is there a mechanism for forcibly clearing the message queue so that this can be avoided? Thanks in advance!