MQTT Timestamp

384 views
Skip to first unread message

Mickey Mx

unread,
May 22, 2023, 9:30:32 AM5/22/23
to MQTT
I have two question regarding MQTT:
1. Does MQTT timestamp all messages?
2. If yes to 1.; Using MQTT in Node-Red, how to extract the timestamp in a function node?

Andy Stanford-Clark

unread,
May 22, 2023, 9:40:07 AM5/22/23
to mq...@googlegroups.com
1. No
We very consciously did not put timestamps into the MQTT protocol, mainly because of the notoriously difficult problem of distributing accurate time to edge devices.
If your device knows the time, and wants to put it in a payload, that’s up to the application, and the receiving applications will know how to extract it, of course.

MQTT v5 has the notion of message time to live - that’s based on how long it sits in a queue in a broker, and does not rely on knowing wall-clock time.

I hope that helps.
Andy

--
To learn more about MQTT see https://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mqtt/0b2b5503-e2bf-4f43-b527-01315b7eaad7n%40googlegroups.com.

Roger Light

unread,
May 22, 2023, 9:50:22 AM5/22/23
to mq...@googlegroups.com
Hi,

As Andy says, no. However there is a plugin for mosquitto which will add an MQTT v5.0 user property with the timestamp of when the broker received the message. If you're using MQTT v5.0, that might be good enough for you: https://github.com/eclipse/mosquitto/tree/master/plugins/message-timestamp

Regards,

Roger

Mickey Mx

unread,
May 22, 2023, 10:03:32 AM5/22/23
to MQTT
Thanks to all for the information. I didn't think each message was timestamped; however, when I saw timestamps in the "Debug", I wanted to confirm that it's just the debug-node that timestamps.
Thanks again.

Mickey Mx

unread,
May 22, 2023, 10:09:36 AM5/22/23
to MQTT
BTW: I don't see any icons to re-open a message to edit; is editing disallowed?

Andy Stanford-Clark

unread,
May 22, 2023, 10:27:05 AM5/22/23
to 'Simon Walters' via MQTT
Which application are you referring to?

Mickey Mx

unread,
May 22, 2023, 10:30:05 AM5/22/23
to MQTT
Regarding "editing", I was referring to editing one of my posts on this forum after posting.

Nick O'Leary

unread,
May 22, 2023, 10:32:12 AM5/22/23
to mq...@googlegroups.com
This group is managed as a mailing list, rather than a forum. You cannot edit old posts because those edits will not be seen by users reading the list via their email inbox.

Andy Stanford-Clark

unread,
May 22, 2023, 10:32:40 AM5/22/23
to mq...@googlegroups.com
Oh! I interact with this list via email, so I don’t know :)

Andy

Matt Lloyd

unread,
May 22, 2023, 10:34:09 AM5/22/23
to mq...@googlegroups.com
This is not a forum, its an email mailing list

You can not edit emails that have already been delivered to 100’s of people inbox’s

https://groups.google.com/g/mqtt/ just gives some people a nice html view to the list

Matt

Mickey Mx

unread,
May 22, 2023, 10:34:36 AM5/22/23
to MQTT
Thanks Nick & Andy. May be I'll just interact via email also.

Mickey Mx

unread,
May 22, 2023, 10:39:08 AM5/22/23
to MQTT
Yeah Matt, I thought about that just after I posted the question.
Thanks Mickey
Reply all
Reply to author
Forward
0 new messages