Search code examples
mqttiotaws-iot

Why AWS MQTT Broker is disconnected from client when retain is set to true while publishing?


I am testing IOT implementation with AWS MQTT broker from my mqttx client app. When i set retain : false, everything works, I am able to send and get messages but when the retain is set to true it doesn't work at all. Client is disconnected as soon as i publish message and i don't get any response back. I have tried adding option cleanSession : true but no luck. My connection is a secured connection with all certificates being proper.


Solution

  • Make sure the IoT Policy attached to your thing supports:

    iot:RetainPublish
    

    Otherwise it won't work.