Replace MQTT deprecated API usage
Motivation: Mqtt procotol defines packetId instead of messageId, replace deprecated method to match protocol definition Modification: Replace messageId() to packetId() in MqttEncoder Result: Match mqtt protocol definition and improve readability.
This commit is contained in:
parent
84ebf47515
commit
7e823e3842
@ -323,7 +323,7 @@ public final class MqttEncoder extends MessageToMessageEncoder<MqttMessage> {
|
||||
buf.writeShort(topicNameBytes.length);
|
||||
buf.writeBytes(topicNameBytes);
|
||||
if (mqttFixedHeader.qosLevel().value() > 0) {
|
||||
buf.writeShort(variableHeader.messageId());
|
||||
buf.writeShort(variableHeader.packetId());
|
||||
}
|
||||
buf.writeBytes(payload);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user