thingsboard / tbmq

Open-source, scalable, and fault-tolerant MQTT broker able to handle 4M+ concurrent client connections, supporting at least 3M messages per second throughput per single cluster node with low latency delivery. The cluster mode supports more than 100M concurrently connected clients.
https://thingsboard.io/products/mqtt-broker/
Apache License 2.0
572 stars 46 forks source link

[Bug] Shared Subscriptions with Qos 0 #69

Closed dmytro-landiak closed 12 months ago

dmytro-landiak commented 12 months ago

Describe the bug When using the Shared Subscriptions feature with both Device and Application persistent clients and when QoS=0 is used, the processing is broken. More details below.

For Application clients (QoS=0 for either publish messages or for subscriptions) - the processing of data is not reliable - not all messages are delivered right away and the lag is growing. For Device clients - when all clients in the shared subscription group go offline and then some of them go online with sub QoS=0 - the messages are delivered but not cleared from DB thus for the next connection of the client from the same group the messages will be delivered once again.

Additionally, shared subscription processing is launched only with Subscribe messages received, thus not working correctly for persistent subscribers that go offline and then back online without sending Subscribe.