Retain on MQTT Node not working

Hello Folks,

I have recently been using the MQTT node on Node Red yet trying to use the retain functionality on the Node.

Has anyone else had issues that when using the retain function no data is updated on that specific topic?

Thank you,

What broker are you using?

Do you know how retain works?

Yes, retain keeps the latest message on file and then when a new subscriber connects to the topic he/she will get that latest message?

For context - I have a mqtt set up with QoS 0 and retain false - the issue I`m having is when people connect to such after a while no data is shown on MQTT as it forgets it , but when I put it as retain true no data changes.

So what broker are you using?

Does retained messages appear on any / other clients?

Are you using MQTT v5? with a message expiry interval?

Is that a typo? If you set "retain false", the new subscribers wont get a retained message.

No it doesnt appear on any other clients,

I am using Mqtt v5 Aws , but I am unsure how to check the message expiry interval - any advise how to find this?

No typo. The message must be expiring after a set time.

It was my understanding AWS doesn't support MQTT v5?

Have you tried with a local broker (or is node-red also running in AWS)?

Node red is running with the AWS broker - apologises I thought this was MQTT v5.

Does this mean I can`t retain messages?

No. It means it's not doing "message timeout interval" (since that is a v5 feature)

You need to look into AWS and retained messages. Try their forums.

I can say is mqtt and retained messages work perfectly well on mine and thousands of other systems. The difference is you are on AWS.

1 Like

Ah okay so just checking online AWS doesn`t actually support retain messages and instead disconnects from the device.

I will do some digging re if there is a message timeout interval instead.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.