[Bug] When sending a message with qos=2, according to the MQTT 3.1.1 protocol, MQTTX should first store the message locally and then proceed with sending.
在发送qos=2的消息,根据mqtt3.1.1的协议,mqttx应该先把该消息存储在本地,然后进行发送
Thank you for raising this issue, @EasyProgramming . We ensure local storage for each message, as per the protocol requirements. Can you please provide more details about the specific problem you're encountering?
Okay, after MQTTX sends a message with QoS=2 via a PUBLISH packet, if it does not receive a PUBREC packet for a long time, it will delete this message. This is incorrect. It should delete the message after receiving the broker’s compensatory PUBREC packet or the user manually deletes it.
Okay, after MQTTX sends a message with QoS=2 via a PUBLISH packet, if it does not receive a PUBREC packet for a long time, it will delete this message. This is incorrect. It should delete the message after receiving the broker’s compensatory PUBREC packet or the user manually deletes it.
中文:好的,当mqttx通过publish报文发送qos=2的消息之后,如果长时间没有收到pubrec报文的话,会将这条消息删除,这是不对的,应当是在收到broker的补偿pubrec报文之后删除或者用户手动删除
Thank you for clarifying, @EasyProgramming.
To ensure I fully grasp the issue, are you suggesting that because the QoS2 message did not send successfully, it also wasn't stored locally by MQTTX? Could you provide some more detailed steps to reproduce this so we can better diagnose and address the problem? We appreciate your cooperation.
步骤一:mqttx与mqtt broker建立连接,cleanSession为false 步骤二:mqttx订阅了topic a,之后,向topic a发送了一条qos2的消息(publis报文) 步骤三:mqtt broker收到了mqttx发送的publish报文,但是向mqttx发送pubrec报文之前,发生了宕机,导致pubrec报文未发送 经过了这三个步骤,mqttx会把发送的这条qos=2的消息删除,这样是不对的,mqttx应该把这条qos=2的消息持久化到本地,然后等待pubrec报文
Step one: MQTTX establishes a connection with the MQTT broker with cleanSession set to false.
Step two: MQTTX subscribes to topic a and then sends a message with qos=2 (publish message) to topic a.
Step three: The MQTT broker receives the publish message sent by MQTTX, but before sending the pubrec message to MQTTX, the broker crashes, resulting in the pubrec message not being sent.
After these three steps, MQTTX deletes the sent message with qos=2. This is not correct. MQTTX should persist this qos=2 message locally and wait for the pubrec message.
Thank you for detailing the reproduction steps. I cannot completely reproduce the issue based on the efforts you've given me. However, I'll investigate this further and get back to you once I have more information.