Replies: 3 comments 1 reply
-
|
Hi Francesco, as I explained in that topic this is how MQTT protocol works, there is nothing on protocol specs that mentions timeouts on publish or a way to cancel outgoing messages. So yes even if the timeout triggers when and if the client connection will go up that message will be sent anyway. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, thank you for the reply.
In this scenario we must avoid to make the memory "explode" by storing into the queue an unlimited number of packets, and also, in this case all these packets will be also duplicated (data is sent "in order") So there is a way to minimize this issue? Maybe, via a manual timeout as in the linked issue, plus a manual mqtt queue clearing? Or maybe something better? Thank you, |
Beta Was this translation helpful? Give feedback.
-
|
Hi, ok thank you. I'll probably try something similar. Regards |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have read the following "old" issue:
#1987
which shows also a code snippet on how to workaround the publish never failing if the broker goes down.
Here I report the proposed snippet:
But this is my doubt:
in case of timeout, since the message is actually still enqueued for a publish, isn't this a memory leak?
In case of memory constraint, couldn't this lead to a always growing memory which is never cleaned?
Or even, since the application code fails, it will never know whether whether message has been actually sent (for example, if the connection turns up again).
Thank you for the clarification.
Regards
Beta Was this translation helpful? Give feedback.
All reactions