diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java index fc61dd9fa9..c985c0f3fd 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java @@ -90,16 +90,7 @@ public class MQTTPublishManager { } private int generateMqttId(int qos) { - if (qos == 1) { - return session.getSessionState().generateId(); - } - else { - Integer mqttid = session.getSessionState().generateId(); - if (mqttid == null) { - mqttid = (int) session.getServer().getStorageManager().generateID(); - } - return mqttid; - } + return session.getSessionState().generateId(); } /**