|
@@ -50,10 +50,12 @@ import java.util.Map; |
|
@@ -50,10 +50,12 @@ import java.util.Map; |
50
|
public class TbMsgTimeseriesNode implements TbNode {
|
50
|
public class TbMsgTimeseriesNode implements TbNode {
|
51
|
|
51
|
|
52
|
private TbMsgTimeseriesNodeConfiguration config;
|
52
|
private TbMsgTimeseriesNodeConfiguration config;
|
|
|
53
|
+ private long tenantProfileDefaultStorageTtl;
|
53
|
|
54
|
|
54
|
@Override
|
55
|
@Override
|
55
|
public void init(TbContext ctx, TbNodeConfiguration configuration) throws TbNodeException {
|
56
|
public void init(TbContext ctx, TbNodeConfiguration configuration) throws TbNodeException {
|
56
|
this.config = TbNodeUtils.convert(configuration, TbMsgTimeseriesNodeConfiguration.class);
|
57
|
this.config = TbNodeUtils.convert(configuration, TbMsgTimeseriesNodeConfiguration.class);
|
|
|
58
|
+
|
57
|
}
|
59
|
}
|
58
|
|
60
|
|
59
|
@Override
|
61
|
@Override
|
|
@@ -77,6 +79,9 @@ public class TbMsgTimeseriesNode implements TbNode { |
|
@@ -77,6 +79,9 @@ public class TbMsgTimeseriesNode implements TbNode { |
77
|
}
|
79
|
}
|
78
|
String ttlValue = msg.getMetaData().getValue("TTL");
|
80
|
String ttlValue = msg.getMetaData().getValue("TTL");
|
79
|
long ttl = !StringUtils.isEmpty(ttlValue) ? Long.parseLong(ttlValue) : config.getDefaultTTL();
|
81
|
long ttl = !StringUtils.isEmpty(ttlValue) ? Long.parseLong(ttlValue) : config.getDefaultTTL();
|
|
|
82
|
+ if (ttl == 0L) {
|
|
|
83
|
+ ttl = tenantProfileDefaultStorageTtl;
|
|
|
84
|
+ }
|
80
|
ctx.getTelemetryService().saveAndNotify(ctx.getTenantId(), msg.getOriginator(), tsKvEntryList, ttl, new TelemetryNodeCallback(ctx, msg));
|
85
|
ctx.getTelemetryService().saveAndNotify(ctx.getTenantId(), msg.getOriginator(), tsKvEntryList, ttl, new TelemetryNodeCallback(ctx, msg));
|
81
|
}
|
86
|
}
|
82
|
|
87
|
|