From f8788a9f6cbad154c505c63be9602f2eb324e0c8 Mon Sep 17 00:00:00 2001 From: Pavel Drankov Date: Tue, 6 Jun 2017 00:21:49 +0400 Subject: [PATCH] =?UTF-8?q?Issue=20=E2=84=966802.=20Not=20specified=20fiel?= =?UTF-8?q?d=20in=20MQTT=20codec=20(#6807)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../codec/mqtt/MqttPublishVariableHeader.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttPublishVariableHeader.java b/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttPublishVariableHeader.java index 6422d53b90..a0d0481b14 100644 --- a/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttPublishVariableHeader.java +++ b/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttPublishVariableHeader.java @@ -24,19 +24,27 @@ import io.netty.util.internal.StringUtil; public final class MqttPublishVariableHeader { private final String topicName; - private final int messageId; + private final int packetId; - public MqttPublishVariableHeader(String topicName, int messageId) { + public MqttPublishVariableHeader(String topicName, int packetId) { this.topicName = topicName; - this.messageId = messageId; + this.packetId = packetId; } public String topicName() { return topicName; } + /** + * @deprecated Use {@link #packetId()} instead. + */ + @Deprecated public int messageId() { - return messageId; + return packetId; + } + + public int packetId() { + return packetId; } @Override @@ -44,7 +52,7 @@ public final class MqttPublishVariableHeader { return new StringBuilder(StringUtil.simpleClassName(this)) .append('[') .append("topicName=").append(topicName) - .append(", messageId=").append(messageId) + .append(", packetId=").append(packetId) .append(']') .toString(); }