Hi guys,
I'm experiencing the same issue. My client connects with clean_session=1. After a reconnection, it resumes the flow, sending a PUBREL. But at this point the broker (version 1.4.10) has cleaned the previous state and the mid cannot be found in its database. So it respond with a PUBCOMP, despite the fact that this message has never completed the flow. This is causing messages with QoS=2 beeing lost.
mosquitto_new documentation is saying:
* clean_session - set to true to instruct the broker to clean all messages
* and subscriptions on disconnect, false to instruct it to
* keep them. See the man page mqtt(7) for more details.
* Note that a client will never discard its own outgoing
* messages on disconnect. Calling <mosquitto_connect> or
* <mosquitto_reconnect> will cause the messages to be resent.
* Use <mosquitto_reinitialise> to reset a client to its
* original state.
I'm understandig that after a reconnection, inflight messages should be republished. Why I'm seeing a PUBREL immediatly after the reconnection?
Thanks