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
10dfd36030
commit
82e5ca7e7f
@ -323,7 +323,7 @@ public final class MqttEncoder extends MessageToMessageEncoder<MqttMessage> {
|
|||||||
buf.writeShort(topicNameBytes.length);
|
buf.writeShort(topicNameBytes.length);
|
||||||
buf.writeBytes(topicNameBytes);
|
buf.writeBytes(topicNameBytes);
|
||||||
if (mqttFixedHeader.qosLevel().value() > 0) {
|
if (mqttFixedHeader.qosLevel().value() > 0) {
|
||||||
buf.writeShort(variableHeader.messageId());
|
buf.writeShort(variableHeader.packetId());
|
||||||
}
|
}
|
||||||
buf.writeBytes(payload);
|
buf.writeBytes(payload);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user