From 654bb84c6d2f444243f6c21431376a2b76554252 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Tue, 9 May 2017 19:21:40 +0530 Subject: [PATCH] handle disconnection scenario for multi tenant mqtt receiver --- .../device/mgt/input/adapter/mqtt/MQTTEventAdapter.java | 4 ++++ 1 file changed, 4 insertions(+) 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 eed3f82bc..8f5c996d0 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() {