IoT broker: Publish mqtt messages with messageExpiry doesn't seem to work

0

I'm using boto3 to publish messages to some mqtt topic. I've tried both approaches retain=True and retain=False messages with a generally low value for messageExpiry (initially 10 seconds and then 1, 60, 120, and other values in case that was the issue) but it doesn't seem to work.

With retain=True I'd expect the message to expire and delete itself after messageExpiryseconds, but it doesn't (a client connecting after the publish does receive the message, of course). With retain=False I would expect a client that connects a few seconds after the publish operation (but before messageExpiry seconds) to receive the published message, but it doesn't.

So not sure if I'm missing some configuration, messageExpiry doesn't work as I would expect (though according to the table from https://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html#mqtt5 it should work) or I'm doing something wrong.

jesusgs
asked a year ago282 views
3 Answers
0
Accepted Answer

When the original question was posted they weren't working. They do work now as expected.

jesusgs
answered 9 months ago
  • Correct. I neglected to post a comment back here that it was confirmed as a bug. The fix was deployed a couple of months ago.

0

Hi jesusgs. I concur with your findings. In using either boto3 or the AWS CLI, I find that the messageExpiry parameter isn't working. Conversely, if I publish using the MQTT test client in AWS IoT Core, it does work.

I'm of the (perhaps mistaken) belief it's an issue on our side with the IoT data plane HTTP Publish operation. I've raised it internally and will post back here when I know more.

profile pictureAWS
EXPERT
Greg_B
answered a year ago
  • I'm facing same issue with Java SDK IoT Data plane, are there any updates on this?

0
AWS
EXPERT
answered 9 months ago
  • I added this comment in case someone comes back to this question

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions