vert-x3 / vertx-mqtt

Vert.x MQTT
Apache License 2.0
184 stars 86 forks source link

convert will message in mqtt options from string to buffer #244

Closed JeffreyThijs closed 10 months ago

JeffreyThijs commented 10 months ago

Motivation:

The payload of the will message now requires to be stored in the MqttClientOptions as a String and is afterwards converted to byte[] assuming UTF-8 in the MqttClientImpl when connecting. This is different from the publish methods where a Buffer is required. Additionally, when the will message payload is binary (e.g. in SparkplugB) converting this to a string feels wrong and might lead to unnecessary conversion issues.

tsegismont commented 10 months ago

Thanks for sharing this. Can you post some more details (e.g. snippet) about the problem?

JeffreyThijs commented 10 months ago

Thanks for sharing this. Can you post some more details (e.g. snippet) about the problem?

Here is a reproducer:

https://github.com/JeffreyThijs/vertx-mqtt-reproducer/blob/master/src/test/kotlin/jthijs/TestMqttWillMessage.kt

JeffreyThijs commented 10 months ago

@tsegismont, i think i made all changes you suggested.

tsegismont commented 10 months ago

@JeffreyThijs @ppatierno I've made some updates and merged the PR

Thank you both!

tsegismont commented 10 months ago

I will take care of backporting to 4.x