Outgoing publish message was dropped. Reason: The QoS 0 memory limit exceeded
Problem
When you see the following log message in the hivemq logs
Outgoing publish message was dropped. Receiving shared subscription: $share/abc/#, topic: abc/test, qos: 0, reason: The QoS 0 memory limit exceeded, size: 52,428,884 bytes, max: 52,428,800 bytes.
Solution
The error you're experiencing typically occurs when the receiving client is either offline or is too slow to consume messages at the rate they are being published. This can lead to issues, particularly with QoS 0 messages, which do not have any delivery guarantees. If the client is unable to receive a message at the time of publishing, the message will be dropped.
In the case of HiveMQ, the maximum amount of memory allocated for QoS 0 message queuing is set to 1/4 of the available system memory, with a 5MB limit per client. Once this limit is reached, any additional messages will be dropped.
It would be helpful to investigate why clients are either offline or unable to consume messages more quickly. Additionally, it’s worth considering whether QoS 0 is necessary for these messages.
QoS 1, for instance, offers defined per-client queuing and delivery guarantees, which can help resolve these issues if you don't specifically require QoS 0.
You can also monitor dropped messages by subscribing to the MQTT Add-on topic $dropped
, which provides details about the messages that were not delivered. For more information, please refer to our documentation.