diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DeviceDataPublisher.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DeviceDataPublisher.java index bcf51ebdae8..04f90307606 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DeviceDataPublisher.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DeviceDataPublisher.java @@ -83,7 +83,7 @@ public class DeviceDataPublisher { * */ public DataPublisher getDataPublisher() throws DataPublisherConfigurationException { - String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); + String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(true); //Get LoadBalancingDataPublisher which has been registered for the tenant. DataPublisher dataPublisher = getDataPublisher(tenantDomain); //If a LoadBalancingDataPublisher had not been registered for the tenant.