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

Document token.Wait behaviour during reconnect #565

Merged
merged 1 commit into from
Dec 8, 2021

Conversation

ecksun
Copy link
Contributor

@ecksun ecksun commented Dec 6, 2021

When a connection is lost to the broker and later resumed the token
returned to the user will be considered completed and a new token will
be created instead. The result of this is that there is no way for a
user of this library to know whether a message has been delivered in the
presence of connection issues.

This PR documents the behavior found in #563

@ecksun ecksun force-pushed the docs/token_wait branch 2 times, most recently from 9496984 to 6eb33f5 Compare December 6, 2021 21:05
README.md Outdated
@@ -129,6 +129,7 @@ may lead to messages being silently dropped.
* `persistence` - Defaults to false (messages will not survive a broker restart)
* `max_keepalive` - defaults to 65535 and, from version 2.0.12, `SetKeepAlive(0)` will result in a rejected connection
by default.
* `token.Wait()` - Will return successfully before a message has been delivered if the client needs to reconnect to the broker before the message has been delivered.
Copy link
Contributor

@MattBrittan MattBrittan Dec 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move up above the "If using Mosquitto then there are a range of fairly common issues:" line (as this is not specific to Mosquitto). I would suggest something like the following (to mirror the format of previous comments and reflect the impact of options):

Publish tokens will complete if the connection is lost and re-established using the default options.SetAutoReconnect(true) functionality (token.Error() will return nil). Attempts will be made to re-deliver the message but there is currently no easy way to monitor this.

token.go Outdated Show resolved Hide resolved
When a connection is lost to the broker and later resumed the token
returned to the user will be considered completed and a new token will
be created instead. The result of this is that there is no way for a
user of this library to know whether a message has been delivered in the
presence of connection issues.

Signed-off-by: Linus <[email protected]>
@MattBrittan MattBrittan merged commit aa9a7a1 into eclipse-paho:master Dec 8, 2021
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

Successfully merging this pull request may close these issues.

2 participants