Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does QOS2 also queue messages if connection is gone while publishing the QOS2 message? #65

Open
kenvernaillenvub opened this issue Aug 10, 2017 · 3 comments

Comments

@kenvernaillenvub
Copy link

kenvernaillenvub commented Aug 10, 2017

When I publish a certain message while internet is down, it should be queued and sent later on. Is this already implemented in QOS2? If it is QOS2, will this keep trying to send it? Because the first line in MQTT::publish is if (isConnected()) { and I think it will automatically return false and don't send it. What is the best way to make sure I don't lose any QOS2 messages?

@hirotakaster
Copy link
Owner

@kenvernaillenvub
Hi, this lib don't store message on QoS=2. Instead of store the message, you can use the QoS2 message callback function(addQosCallback) for check the message really sent or not on your application.

@mkesselaers
Copy link

Hi,

I have a similar request.
How would you tackle this?
Using the callback would mean that you would need to build a dict if you have multiple QOS2-messages that need to be pushed.

I'm quite new to MQTT so if you could provide an example, I would be forever grateful

Thanks,
Maarten

@hirotakaster
Copy link
Owner

hi @kenvernaillenvub
This library don't have like a message queue or re-send message. If you want to use multiple QoS2 message, you have to manage QoS2 message id by yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants