diff --git a/modules/samples/virtual_firealarm/FireAlarm/api/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/VirtualFireAlarmService.java b/modules/samples/virtual_firealarm/FireAlarm/api/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/VirtualFireAlarmService.java index c3bcf202..20cc4a27 100644 --- a/modules/samples/virtual_firealarm/FireAlarm/api/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/VirtualFireAlarmService.java +++ b/modules/samples/virtual_firealarm/FireAlarm/api/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/VirtualFireAlarmService.java @@ -528,8 +528,7 @@ public class VirtualFireAlarmService { return; } } catch (DeviceManagementException e) { - log.error("Failed to send switch-bulb request to device [" + deviceId + "] via " + - protocolString); + log.error("Failed to send switch-bulb request to device [" + deviceId + "] via " + protocolString); response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); return; } diff --git a/modules/samples/virtual_firealarm/FireAlarm/api/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/transport/VirtualFireAlarmMQTTSubscriber.java b/modules/samples/virtual_firealarm/FireAlarm/api/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/transport/VirtualFireAlarmMQTTSubscriber.java index 729379e0..cce48c3c 100644 --- a/modules/samples/virtual_firealarm/FireAlarm/api/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/transport/VirtualFireAlarmMQTTSubscriber.java +++ b/modules/samples/virtual_firealarm/FireAlarm/api/src/org.wso2.carbon.device.mgt.iot.sample.virtual.firealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/sample/virtual/firealarm/service/impl/transport/VirtualFireAlarmMQTTSubscriber.java @@ -68,6 +68,10 @@ public class VirtualFireAlarmMQTTSubscriber extends MqttSubscriber { actualMessage = VirtualFireAlarmServiceUtils.extractMessageFromPayload(mqttMessage.toString(), serverPrivateKey, clientPublicKey); + if (log.isDebugEnabled()) { + log.debug("MQTT: Received Message [" + actualMessage + "] topic: [" + topic + "]"); + } + if (actualMessage.contains("PUBLISHER")) { float temperature = Float.parseFloat(actualMessage.split(":")[2]); @@ -76,16 +80,10 @@ public class VirtualFireAlarmMQTTSubscriber extends MqttSubscriber { } if (log.isDebugEnabled()) { - log.debug("MQTT: Publisher Message [" + actualMessage + "] topic: [" + topic + "]"); log.debug("MQTT Subscriber: Published data to DAS successfully."); } } else if (actualMessage.contains("TEMPERATURE")) { - - if (log.isDebugEnabled()) { - log.debug("MQTT: Reply Message [" + actualMessage + "] topic: [" + topic + "]"); - } - String temperatureValue = actualMessage.split(":")[1]; SensorDataManager.getInstance().setSensorRecord(deviceId, VirtualFireAlarmConstants.SENSOR_TEMPERATURE, temperatureValue,