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

Introduce a warning timeout for MQTT topics #697

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

gbeine
Copy link

@gbeine gbeine commented Jul 7, 2024

The feature allows to define a parameter 'timeout' for each topic. The timeout is specified in seconds.

Instead of notifying targets when a message arrives for a topic, mqttwarn will trigger the targets if no message is received on the topic for the specified period of time.

That's the first version of this feature, so any feedback is welcome.

Gerrit Beine added 4 commits July 7, 2024 16:40
The feature allows to define a parameter 'timeout' for each topic.
The timeout is specified in seconds.

Instead of notifying targets when a message arrives for a topic, mqttwarn will trigger the targets if no message is received on the topic for the specified period of time.
Reduced invasiveness
- removed message_to_targets_handler by passing send_to_targets as on_timeout callback
- introduced notify_only_on_timeout switch for allowing notifications for arriving messages, too
@amotl
Copy link
Member

amotl commented Oct 19, 2024

Hi Gerrit,

apologies for the late reply. That's a nice liveness sensor you are contributing here. I didn't have a look at the details yet, but if @jpmens or @sumnerboy12 don't have any objections about adding that as a new kind of feature, let's try to bring it into mainline.

While your implementation looks pretty solid, I may have a few suggestions about design and implementation details as we go.

With kind regards,
Andreas.

@gbeine
Copy link
Author

gbeine commented Oct 19, 2024

@amotl Thank you - and no problem, we're all busy folks ;-)

I'd welcome any feedback as I'm not sure if I've done the implementation in the most effective way.
All I can say is, that it runs on some Raspberry Pi 2 and 4 machines with about 70 to 150 topics stable for months.

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