diff --git a/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/controlqueue/mqtt/MqttSubscriber.java b/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/controlqueue/mqtt/MqttSubscriber.java index a80af1dc77..8b28a508fa 100644 --- a/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/controlqueue/mqtt/MqttSubscriber.java +++ b/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/controlqueue/mqtt/MqttSubscriber.java @@ -120,7 +120,7 @@ public abstract class MqttSubscriber implements MqttCallback { } options = new MqttConnectOptions(); - options.setCleanSession(false); + options.setCleanSession(true); options.setWill(clientWillTopic, "connection crashed".getBytes(StandardCharsets.UTF_8), 2, true); client.setCallback(this); }