Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

hcrgm
Copy link
Contributor

@hcrgm hcrgm commented Aug 16, 2024

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
Copy link
Member

Good work, thanks!

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

@rubengees rubengees merged commit 1274b38 into SmartsquareGmbH:main Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PublishingOptions without specifying messageExpiryInterval results in publish failure
2 participants