-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
…cted on the object that is beeing sent with connection.
Can you please add a test? |
Any tips on where I can add this? Would love to get some help at least to start. |
Can you create a test similar to https://github.com/micronaut-projects/micronaut-mqtt/blob/3.4.x/test-suite-utils/src/main/groovy/io/micronaut/mqtt/test/intercept/SimplePubSubSpec.groovy to reproduce it? |
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.
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.
Ok, I got tests to pass with second context that can verfiy that will message was applied. |
Thanks! |
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