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

Use QOS1 for rarely sent discovery and availability messages #18756

Merged
merged 3 commits into from
Aug 27, 2023

Conversation

ruifung
Copy link
Contributor

@ruifung ruifung commented Aug 27, 2023

Specifically discovery and availability depending on the set up, it's possible for these messages to be silently discarded by the broker.

Sending them as QOS1 means the underlying MQTT library used will resend them until it gets an ACK.
Ensuring delivery is particularly important for messages that are rarely sent like discovery or availability as they are only sent when there are changes, and if the broker silently drops the message for whatever reason (congestion, or broker clustering issues), this will impede proper functioning of Z2M with home assistant due to missing/stale retained messages.

And at-least-once semantics seem to be an appropriate fit for discovery and availability messages.

Specifically on my setup with a EMQ X broker on kubernetes. I've observed some discovery messsages just outright going missing or getting dropped by broker and sending them at QOS1 seems to resolve it.

Specifically discovery and availability depending on the set up, it's possible for these messages to be silently discarded by the broker.

Sending them as QOS1 means the mqtt library used will resend them until it gets an ACK.
Ensuring delivery is particularly important for messages that are rarely sent like discovery or availability as they are only sent when there are changes, and nondelivery or dropped messages for them impede proper functioning in home assistant.
@Koenkk Koenkk changed the base branch from master to dev August 27, 2023 06:23
@Koenkk Koenkk enabled auto-merge (squash) August 27, 2023 06:23
@Koenkk
Copy link
Owner

Koenkk commented Aug 27, 2023

Thanks!

@Koenkk Koenkk merged commit d1e50ce into Koenkk:dev Aug 27, 2023
11 checks passed
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