SmartsquareGmbH / mqtt-starter

HiveMQ Spring Boot Starter
MIT License
15 stars 5 forks source link

Fix "messageExpiryInterval" check failure in MQTT 5 publish #19

Closed hcrgm closed 1 month ago

hcrgm commented 1 month ago

Mqtt5PublishBuilder will check messageExpiryInterval parameter in its builder method, which results in assertion failure if PublishingOptions.messageExpiryInterval is left unspecified or maintained at its default setting. Using Mqtt5PublishBuilder#noMessageExpiry() to explicitly denote "no message expiry" when retaining the default messageExpiryInterval. This fixes #18. The upstream have introduced a special value -1 to disable message expiry in Mqtt5PublishBuilder.messageExpiryInterval, but haven't released so far. References: hivemq/hivemq-mqtt-client#580, hivemq/hivemq-mqtt-client#604.

rubengees commented 1 month ago

Good work, thanks!

I'll add a small regression test and then release this.