Commit cc9a951d authored by 张森's avatar 张森

发送iot消息时发送traceId

parent c9233097
...@@ -401,7 +401,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -401,7 +401,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
if (isSendIot) { if (isSendIot) {
JSONObject messageObj = JSON.parseObject(message); JSONObject messageObj = JSON.parseObject(message);
if (!messageObj.containsKey("traceId")) { if (!messageObj.containsKey("traceId")) {
messageObj.put("traceId", System.currentTimeMillis()); String traceId = System.currentTimeMillis() + "";
messageObj.put("traceId", traceId);
} }
String messageTraceId = JSON.toJSONString(messageObj); String messageTraceId = JSON.toJSONString(messageObj);
mqttSendGateway.sendToMqtt("influxdb/" + topic.substring(0, endIndex), messageTraceId); mqttSendGateway.sendToMqtt("influxdb/" + topic.substring(0, endIndex), messageTraceId);
......
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