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
已提問 1 年前檢視次數 291 次
3 個答案
0
已接受的答案

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

jesusgs
已回答 9 個月前
  • 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
專家
Greg_B
已回答 1 年前
  • I'm facing same issue with Java SDK IoT Data plane, are there any updates on this?

0
AWS
專家
已回答 9 個月前
  • I added this comment in case someone comes back to this question

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南