Deividi Silva
Deividi Silva

Reputation: 846

Duplicate Lifecycle Events

I am building a web app that uses AWS IoT lifecycle events and logs device connection/disconnection. Using AWS IoT rules, I am sending all events to a lambda and after some validation I'm saving all lifecycle events to a DynamoDB table. I'm aware that messages may be delayed, out of order and duplicates may happen. I am validating for all these scenarios, so my connection log is as accurate as possible.

My question is: Is it possible for duplicate messages to come with a distinct timestamp? Such as a disconnection being sent twice with the same sessionIdentifier but a different timestamp?

Upvotes: 1

Views: 497

Answers (1)

Lance Chen
Lance Chen

Reputation: 596

Just some guesses

  1. MQTT QoS 1 implies the "You might receive duplicate messages." thing. The message could be resend by one side if no ack is received from the other side. Thus, it is the same old message, and the timestamp would not change.

  2. The timestamp field refers to the time the event occurred, not the time the message is sent. Thus, it should remain the same value.

Reference: http://docs.aws.amazon.com/iot/latest/developerguide/life-cycle-events.html

Upvotes: 1

Related Questions