emqtt icon indicating copy to clipboard operation
emqtt copied to clipboard

Question about ensuring message delivery between reconnects

Open yangm97 opened this issue 3 years ago • 3 comments

I see emqtt once had an automatic reconnect feature but is has been removed. However I haven't found any recommended replacement.

Doing a quick test reveals unexpected disconnects (for instance, tcp_closed) results in a exit from the emqtt client process, which propagates to my process.

I could probably trap that exit signal and issue a reconnect from my proccess but then what about messages in flight?

Suppose I want to ensure QoS 1-2 messages got sent, do I need to build a queue within my process state and pop items from that queue only after receiving a PUBACK?

yangm97 avatar Feb 04 '22 13:02 yangm97

@yangm97 I have added reconnects in this PR with option {reconnect, true} https://github.com/emqx/emqtt/pull/143

Have you tried that ?

qzhuyan avatar Mar 08 '22 11:03 qzhuyan

@qzhuyan nope, if I remember correctly I used the latest release available at that time.

yangm97 avatar Apr 05 '22 11:04 yangm97

Any updates?

qzhuyan avatar Apr 22 '22 13:04 qzhuyan