-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
MQTT Retain Flag #799
Comments
I'd also love to see the retain flag added. It's a critical feature for many use-cases! |
For this request, do you wnat to just cache the last notification sent to disk and nothing more? |
the retain flag is part of the MQTT protocol. The MQTT server itself manages the retention of messages, so no caching would be required for apprise. We just need the option to send the retain flag as a part of the MQTT message. "In MQTT, when a publisher sends a message to a topic, the broker broadcasts it to all the clients subscribed to that topic. But if no clients are subscribed to the topic when a message is sent, the broker discards the message. Consequently, new or reconnecting clients will never receive the message — this is where retained messages come in. The retained messages feature allows MQTT brokers to persist the last known message on a topic. You can enable this feature by sending a PUBLISH packet to the broker with the retain flag set to true (retain=1). When the broker sees this flag, it knows to persist the message in the topic it’s been published to. That way, new or reconnecting subscribers get that last message when they join the topic." |
I feel so stupid, I'm so, so sorry. I thought this request was to actually have Apprise persist the last message. I didn't realize it's just a flag passed along 😬. I'll have a look at the mqtt docs for the library Apprise depends on. It should be straight forward i hope |
Take your time. This was almost two years ago and I can't remember why I needed it now, so I must have worked around it. |
Issue resolved in very simple PR. The amount of time you all waited ws a big issue between my keyboard and chair... 🤦♂️ 👀 . What's important is the next release of Apprise will have this even if now (this many years later) it's of no use to you |
We all have those moments. completely understand. It's just a good thing you didn't put it on the internet and tell people!! :) I'm actually starting to have an idea why I wanted it, so all is not lost! |
Update: Just tested this in a controlled env and IT VERKS!!!! (Best said with a German accent). |
💡 The Idea
Would it be possible to add a retain flag to the MQTT notification?
It would be handy to see what the last notification was before a reboot or close of subscription for any reason.
I suppose QOS could be done at the same time if you're in the code, but the retain flag would be a nice addition.
The text was updated successfully, but these errors were encountered: