[IoT Core] Duplicate messages from topic forwarding rule

0

Hi,

I have created a topic forwarding rule in AWS IoT Core using this rule.

SELECT * from 'data/device01' WHERE temperature > 35

This rule forwards messages to the topic 'data/alarms'. I used QoS 0.

I observed duplicate messages like this from the subscription of 'data/alarms'

data/alarms
August 05, 2020, 14:36:01 (UTC+0900)
Export
Hide
{
  "device": "device02",
  "temperature": 35.02,
  "brightness": 12,
  "humidity": 87,
  "time": "2020.08.05 07:36:01"
}
data/alarms
August 05, 2020, 14:36:01 (UTC+0900)
Export
Hide
{
  "device": "device02",
  "temperature": 35.02,
  "brightness": 12,
  "humidity": 87,
  "time": "2020.08.05 07:36:01"
}

Interesting part is where sometimes there are duplicates and sometimes not.

Question: Is this expected behavior of IoT Core?

Thanks,

profile pictureAWS
gefragt vor 4 Jahren970 Aufrufe
2 Antworten
0
Akzeptierte Antwort

The AWS IoT Core message broker defines MQTT Quality of Service level zero like so:

In AWS IoT Core, subscribing to a topic with QoS level 0 means that a message is delivered zero or more times. A message might be delivered more than once. Messages delivered more than once might be sent with a different packet ID.

https://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html

AWS
Sounavo
beantwortet vor 4 Jahren
profile picture
EXPERTE
überprüft vor 20 Tagen
0

I am having the same issue, was there a fix or a rule that can filter these out while sending? using QOS at 0.

beantwortet vor 5 Monaten
  • Maybe there is a new solution since it has been 3 years. At that time, after some research, the best solution was to use IoT Core -> IoT Rules -> Lambda -> DynamoDB -> DynamoDB Streams to filter out the duplicate messages. Now it seems we can use IoT Rules -> DynamoDB without Lambda. Please thumb up on this so that the AWS IoT Core service engineering team can be aware that people need this de-duplication feature.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen