Commit a596a2bb authored by tianbo's avatar tianbo

info(safety): 增加安全追溯问题消息发送日志- 在发送安全追溯问题消息前,增加主题的日志输出

- 在发送成功后,增加成功的日志输出 - 这些日志有助于监控消息发送过程和排查问题
parent 269cb894
...@@ -194,7 +194,9 @@ public class SafetyProblemTracingGenServiceImpl{ ...@@ -194,7 +194,9 @@ public class SafetyProblemTracingGenServiceImpl{
JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(mapList)); JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(mapList));
if (CollectionUtil.isNotEmpty(jsonArray)){ if (CollectionUtil.isNotEmpty(jsonArray)){
try { try {
logger.info("发送安全追溯问题主题---->{}", safetyProblemTypeEnum.getTopic());
emqKeeper.getMqttClient().publish(safetyProblemTypeEnum.getTopic(), jsonArray.toString().getBytes(StandardCharsets.UTF_8), 2, false); emqKeeper.getMqttClient().publish(safetyProblemTypeEnum.getTopic(), jsonArray.toString().getBytes(StandardCharsets.UTF_8), 2, false);
logger.info("发送安全追溯问题消息成功---->");
} catch (MqttException e) { } catch (MqttException e) {
logger.error("发送安全追溯问题设备信息消息失败---->{}", e.getMessage()); logger.error("发送安全追溯问题设备信息消息失败---->{}", e.getMessage());
throw new RuntimeException(e); throw new RuntimeException(e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment