[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
posta 4 anni fa966 visualizzazioni
2 Risposte
0
Risposta accettata

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
con risposta 4 anni fa
profile picture
ESPERTO
verificato 16 giorni fa
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.

con risposta 5 mesi fa
  • 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.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande