diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/HttpReportingUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/HttpReportingUtil.java index 385f5866b4..2d034d74f9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/HttpReportingUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/HttpReportingUtil.java @@ -25,11 +25,16 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.protocol.HTTP; import org.wso2.carbon.device.mgt.common.exceptions.EventPublishingException; +import org.wso2.carbon.device.mgt.core.DeviceManagementConstants; import java.io.IOException; public class HttpReportingUtil { + public static String getReportingHost() { + return System.getProperty(DeviceManagementConstants.Report.REPORTING_EVENT_HOST); + } + public static int invokeApi(String payload, String endpoint) throws EventPublishingException { try (CloseableHttpClient client = HttpClients.createDefault()) { HttpPost apiEndpoint = new HttpPost(endpoint);