[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
已提問 4 年前檢視次數 966 次
2 個答案
0
已接受的答案

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
已回答 4 年前
profile picture
專家
已審閱 16 天前
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.

已回答 5 個月前
  • 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.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南