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

Bugfix WillMessage in HiveMqttClient #441

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

VytautasCapgemini
Copy link
Contributor

Adding applyWillPublish() method at the end of the willMessageBuilder to make sure changes are published with the connect message.

Ref example here: https://github.com/hivemq/hivemq-mqtt-client/blob/bb5dee551e1e19edbc4d6a9b19037a616a05db4f/examples/src/main/java/com/hivemq/client/mqtt/examples/Mqtt5Features.java

…cted on the object that is beeing sent with connection.
@CLAassistant
Copy link

CLAassistant commented Oct 1, 2024

CLA assistant check
All committers have signed the CLA.

@VytautasCapgemini VytautasCapgemini changed the title Bugfix WillMessage Bugfix WillMessage in HiveMqttClient Oct 1, 2024
@dstepanov
Copy link
Contributor

Can you please add a test?

@VytautasCapgemini
Copy link
Contributor Author

Any tips on where I can add this? Would love to get some help at least to start.

@dstepanov
Copy link
Contributor

This commit introduces a new test class `V5WillMessageSpec` to verify MQTT V5 Will Message functionality. It includes a configuration setup, MQTT client actions, and a subscriber to assert the reception of the will message.
@VytautasCapgemini
Copy link
Contributor Author

Not sure how to check that will message after disconnection, I think subscriber also uses same connection, when I disconnect client, subscriber also disconnects and is not able to get the message and assert that it got it.

Maybe any ideas on how to assert here? I see in external mqtt tools that will message is getting published.

This change introduces an additional application context to subscribe to the will message topic, ensuring the message is published when the first application disconnects. Removed unnecessary properties in the test and included initiating another context for proper validation.
@VytautasCapgemini
Copy link
Contributor Author

Ok, I got tests to pass with second context that can verfiy that will message was applied.

@dstepanov
Copy link
Contributor

Thanks!

@dstepanov dstepanov merged commit 5e0bdf0 into micronaut-projects:3.4.x Oct 2, 2024
18 checks passed
@sdelamo sdelamo added the type: bug Something isn't working label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants