Additional logging of WS commands processing
This commit is contained in:
parent
af03c528af
commit
811f7d7206
@ -95,7 +95,8 @@ public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubsc
|
||||
private static final int DEFAULT_LIMIT = 100;
|
||||
private final Map<String, Map<Integer, TbAbstractSubCtx>> subscriptionsBySessionId = new ConcurrentHashMap<>();
|
||||
|
||||
@Autowired @Lazy
|
||||
@Autowired
|
||||
@Lazy
|
||||
private WebSocketService wsService;
|
||||
|
||||
@Autowired
|
||||
@ -728,7 +729,14 @@ public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubsc
|
||||
public void cancelAllSessionSubscriptions(String sessionId) {
|
||||
Map<Integer, TbAbstractSubCtx> sessionSubs = subscriptionsBySessionId.remove(sessionId);
|
||||
if (sessionSubs != null) {
|
||||
sessionSubs.values().forEach(this::cleanupAndCancel);
|
||||
sessionSubs.values().forEach(sub -> {
|
||||
try {
|
||||
cleanupAndCancel(sub);
|
||||
} catch (Exception e) {
|
||||
log.warn("[{}] Failed to remove subscription {} due to ", sub.getTenantId(), sub, e);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -217,7 +217,11 @@ public class DefaultTbLocalSubscriptionService implements TbLocalSubscriptionSer
|
||||
Map<Integer, TbSubscription<?>> sessionSubscriptions = subscriptionsBySessionId.remove(sessionId);
|
||||
if (sessionSubscriptions != null) {
|
||||
for (TbSubscription<?> subscription : sessionSubscriptions.values()) {
|
||||
try {
|
||||
modifySubscription(subscription.getTenantId(), subscription.getEntityId(), subscription, false);
|
||||
} catch (Exception e) {
|
||||
log.warn("[{}][{}] Failed to remove subscription {} due to ", subscription.getTenantId(), subscription.getEntityId(), subscription, e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log.debug("[{}] No session subscriptions found!", sessionId);
|
||||
|
||||
@ -197,7 +197,8 @@ public class DefaultWebSocketService implements WebSocketService {
|
||||
wsSessionsMap.put(sessionId, new WsSessionMetaData(sessionRef));
|
||||
break;
|
||||
case ERROR:
|
||||
log.debug("[{}] Unknown websocket session error: {}. ", sessionId, event.getError().orElse(null));
|
||||
log.debug("[{}] Unknown websocket session error: ", sessionId,
|
||||
event.getError().orElse(new RuntimeException("No error specified")));
|
||||
break;
|
||||
case CLOSED:
|
||||
wsSessionsMap.remove(sessionId);
|
||||
|
||||
@ -33,7 +33,7 @@ public class WebSocketSessionRef {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final String sessionId;
|
||||
private SecurityUser securityCtx;
|
||||
private volatile SecurityUser securityCtx;
|
||||
private final InetSocketAddress localAddress;
|
||||
private final InetSocketAddress remoteAddress;
|
||||
private final WebSocketSessionType sessionType;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user