-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
Duplicate MQTT SUBSCRIBE for persistent sessions #1912
Comments
It's a good shout - we always re-subscribe on reconnect. The problem with only doing that when Could have it as a config setting for people who explicitly want to turn this behaviour off? |
Andrew,
I think this problem is fixed in MQTT 3.1.1. The CONNACK has a 'session
present' flag which is only set if you have connected to a valid,
pre-existing session - so no subscribes necessary .
No extra configuration is required because the flag will only ever be set
if 'mqttProtocolLevel' is set to 4.
This will only ever be a issue if you decide to change the default for
mqttProtocolLevel in the future
Thanks
…On Sat, 23 Nov 2024 at 19:20, Andrew Rowson ***@***.***> wrote:
It's a good shout - we always re-subscribe on reconnect.
The problem with only doing that when cleanSession=true is that if the
broker is not persisting state, if the broker restarts, then it'll lose the
session and no messages will be received by OT until it explicitly
resubscribes. OT has no way of knowing when it reconnects whether or not a
broker is holding an existing session, hence we always subscribe.
Could have it as a config setting for people who explicitly want to turn
this behaviour off?
—
Reply to this email directly, view it on GitHub
<#1912 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARWEFQEAWCCIE5EIKNIPOYD2CDIPVAVCNFSM6AAAAABRW4WWMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJVGYZDOMRZHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
- Neil
|
Owntracks seems to re-issue subscriptions for a persistent mqtt session even when the protocol version is set to 4 (3.1.1) and the 'session present' flag is set in the CONNACK
This is a shame as it generates a lot of traffic on an unreliable connection
Thanks.
The text was updated successfully, but these errors were encountered: