|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.ruoyi.dataprocess.mqtt.client.listener;
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.constant.HwDictConstants;
|
|
|
|
|
import com.ruoyi.dataprocess.mqtt.client.config.MqttConfiguration;
|
|
|
|
|
import com.ruoyi.dataprocess.service.IDataProcessService;
|
|
|
|
|
import com.ruoyi.dataprocess.service.IDeviceStatusService;
|
|
|
|
@ -23,10 +24,6 @@ import java.nio.charset.StandardCharsets;
|
|
|
|
|
public class MqttClientSubscribeListener {
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(MqttClientSubscribeListener.class);
|
|
|
|
|
|
|
|
|
|
public static final String TOPIC_TYPE_DATA_POSTFIX = "data";
|
|
|
|
|
public static final String TOPIC_TYPE_COMMAND_POSTFIX = "command";
|
|
|
|
|
public static final String TOPIC_TYPE_REPLY_POSTFIX = "reply";
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IDataProcessService dataProcessService;
|
|
|
|
|
|
|
|
|
@ -46,9 +43,9 @@ public class MqttClientSubscribeListener {
|
|
|
|
|
String imagePrefix = mqttConfiguration.getImagePrefix();
|
|
|
|
|
logger.info("topic:{},start:{}ms", topic, start);
|
|
|
|
|
try {
|
|
|
|
|
if (topic.endsWith(TOPIC_TYPE_DATA_POSTFIX)) {
|
|
|
|
|
if (topic.endsWith(HwDictConstants.TOPIC_TYPE_DATA_POSTFIX)) {
|
|
|
|
|
int processDataCount = dataProcessService.processBusinessData(payloadString,
|
|
|
|
|
imagePath, imagePatterns, imageDomain, imagePrefix);
|
|
|
|
|
imagePath, imagePatterns, imageDomain, imagePrefix, topic);
|
|
|
|
|
Long end = System.currentTimeMillis();
|
|
|
|
|
logger.info("Process Data start:{}ms,end:{}ms,Spend Time:{}ms,Data Count:{}", start, end, end - start, processDataCount);
|
|
|
|
|
}
|
|
|
|
|