apache / rocketmq-mqtt

Apache rocketmq
https://rocketmq.apache.org/
Apache License 2.0
181 stars 63 forks source link

The maxLmqConsumeQueueNum count keeps growing due to mqtt #287

Open yx9o opened 3 months ago

yx9o commented 3 months ago

Hi, community Recently, we found a problem when we were stress testing the mqtt service. When there are too many consumers and the clientId is changed after multiple restarts, the message cannot be produced and consumed. The error reported by rmq is as follows:

image

After analyzing this, we found that a large number of ConsumeQueue in memory are /retry and /p2p. This problem occurs because the client will subscribe to the secondary topics /retry and /p2p by default, and they are bound to the clientId. Then, when the client is offline, the broker is not notified to remove the secondary topic from the consumeQueueTable, and the count of maxLmqConsumeQueueNum will not be deducted, which causes it to continue to increase, thereby triggering the exception of maxLmqConsumeQueueNum exceeding the limit.

企业微信截图_0ae52fbe-52c6-4853-84e7-1925eb5eba4b 企业微信截图_bf8f8002-21f5-4436-b7b7-cf9ac10b0871

The rmq version we use is 4.9.8 The mqtt version we use is Release-1.0.1