|
@@ -29,6 +29,7 @@ public class SimpleContext {
|
|
|
Map map_data = JsonUtils.fromJson(message,Map.class);
|
|
|
String deviceId = map_data.get("device_id").toString();
|
|
|
String productId = map_data.get("product_code").toString().toLowerCase();
|
|
|
+ Long timestamp = Long.valueOf(map_data.get("timestamp").toString());
|
|
|
String tableName = productId+'_'+deviceId;
|
|
|
|
|
|
Object tg = JSONObject.toJSONString(map_data.get("tags"));
|
|
@@ -43,7 +44,7 @@ public class SimpleContext {
|
|
|
fields.put(entry.toLowerCase(),metrics.get(entry));
|
|
|
}
|
|
|
|
|
|
- influxDBUtils.insertOne(tableName,tags,fields);
|
|
|
+ influxDBUtils.insertOne1(tableName,tags,fields,timestamp);
|
|
|
}
|
|
|
}
|
|
|
|