Fix subscription service: ignore unmatched updates.

This commit is contained in:
Igor Kulikov 2018-06-15 17:07:01 +03:00
parent 0546cb1e85
commit 1f58c1b0d6
2 changed files with 1 additions and 2 deletions

View File

@ -46,7 +46,6 @@ public class TbWebSocketHandler extends TextWebSocketHandler implements Telemetr
private static final ConcurrentMap<String, String> externalSessionMap = new ConcurrentHashMap<>(); private static final ConcurrentMap<String, String> externalSessionMap = new ConcurrentHashMap<>();
@Autowired @Autowired
@Lazy
private TelemetryWebSocketService webSocketService; private TelemetryWebSocketService webSocketService;
@Override @Override

View File

@ -432,7 +432,7 @@ public class DefaultTelemetrySubscriptionService implements TelemetrySubscriptio
deviceSubscriptions.stream().filter(filter).forEach(s -> { deviceSubscriptions.stream().filter(filter).forEach(s -> {
String sessionId = s.getWsSessionId(); String sessionId = s.getWsSessionId();
List<TsKvEntry> subscriptionUpdate = f.apply(s); List<TsKvEntry> subscriptionUpdate = f.apply(s);
if (subscriptionUpdate == null || !subscriptionUpdate.isEmpty()) { if (subscriptionUpdate != null && !subscriptionUpdate.isEmpty()) {
SubscriptionUpdate update = new SubscriptionUpdate(s.getSubscriptionId(), subscriptionUpdate); SubscriptionUpdate update = new SubscriptionUpdate(s.getSubscriptionId(), subscriptionUpdate);
if (s.isLocal()) { if (s.isLocal()) {
updateSubscriptionState(sessionId, s, update); updateSubscriptionState(sessionId, s, update);