bytebeamio / rumqtt

The MQTT ecosystem in rust
Apache License 2.0
1.53k stars 234 forks source link

In mqttc v5, restore session only if session is resumed #863

Closed xiaocq2001 closed 1 month ago

xiaocq2001 commented 1 month ago

Current Behavior

Currently rumqttc for MQTTv5 always republish packets which aren't acked, no matter it's clean session or resume session.

Expected Behavior

For simple we can use the session_present in CONNACK returned by broker, if it's 1 the session is resumed, if it's 0 the session is new and the pending requests should be discarded.

de-sh commented 1 month ago

@swanandx does broker by default set this correctly?