AWS IoT Publishing duplicate msgs

Hi,

I am having an issue where I am using Node-REDs input MQTT nodes to publish/subscribe to topics via the AWS IoT core broker.
I am using QOS 0.

The issue is when subscribed to the topics on Node-RED I will get duplicate messages. However, at the same time when I subscribe to the AWS web console, only one message will appear.

Any ideas? I am not sure if this is a Node-RED issue or AWS. Was looking at Nod-red as in AWS it's not showing up duplicate. Posting here to see if anyone has the same issue.

Thanks!

I have a vague recollection that there was a bug that could cause this. Are you using the latest version of node-red?

Hey, Sorry it was a bit rude of me to not include the version number. I am running V1.2.2 on both the publisher and subscriber.

Thanks

Can you attach a debug node showing what is being published, and another showing the duplicate message reception and post screenshots of each (for the same message obviously) please.

Also how many mqtt-innodes do you have and what are their topics?

I've done some more testing.

On one instance of Node-RED, I have set up a publish-subscribe. Simply inject the value 200 and I will get the duplicate messages.

image

image

I have hit the inject button 3 times here.

1 - 2 Messages
2 - 1 Message
3 - 2 Messages.

In the AWS Online console. I only got 3 messages.

I would understand this if I was using QoS 1. I believe QoS 1 will deliver "at least once" so having duplicates would seem like something that could happen. However, QoS 0 is just "Fire and forget" I am correct in this way of thinking.

What happens if you use QoS 2?

Are you able to run mosquitto_sub on the PC? If so does it see 2 messages?

Will do when I have some spare time.

Note - I found that AWS says.
QoS 0 = zero or more times.
QoS 1 = one or more times.

Still doesn't explain the issue.

If it doesn't support QoS 2 then obviously you can't try that (which was an attempt to understand the problem better).
Whatever the cause, if it is causing a problem and you want a workaround for the short term then you could add an RBE node after the MQTT In node to suppress messages with the same payload, or if you don't want to suppress them if they are not close together then you could use a Trigger node configured like this, which in the even to two or more messages close together will discard the first ones and just send on the last.

Thanks mate. I like the dark theme you've got there!
I ended up doing the below as a workaround.

image

1 Like