diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/MQTTEventAdapter.java b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/MQTTEventAdapter.java index eed3f82bc7..8f5c996d0d 100644 --- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/MQTTEventAdapter.java +++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/MQTTEventAdapter.java @@ -93,6 +93,10 @@ public class MQTTEventAdapter implements InputEventAdapter { public void disconnect() { //when mqtt and this feature both together then this method becomes a blocking method, Therefore // have used a thread to skip it. + if (!PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain() + .equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) { + return; + } try { Thread thread = new Thread(new Runnable() { public void run() {