DeviceActorMessageProcessor: fixed message on MaxSessionsLimit and test header fixed
This commit is contained in:
parent
66f5e17bab
commit
89fe9514d1
@ -131,7 +131,7 @@ class DeviceActorMessageProcessor extends AbstractContextAwareMsgProcessor {
|
|||||||
this.attributeSubscriptions = new HashMap<>();
|
this.attributeSubscriptions = new HashMap<>();
|
||||||
this.rpcSubscriptions = new HashMap<>();
|
this.rpcSubscriptions = new HashMap<>();
|
||||||
this.toDeviceRpcPendingMap = new HashMap<>();
|
this.toDeviceRpcPendingMap = new HashMap<>();
|
||||||
this.sessions = new LinkedHashMapRemoveEldest<>(systemContext.getMaxConcurrentSessionsPerDevice(), this::notifyTransportAboutClosedSession);
|
this.sessions = new LinkedHashMapRemoveEldest<>(systemContext.getMaxConcurrentSessionsPerDevice(), this::notifyTransportAboutClosedSessionMaxSessionsLimit);
|
||||||
if (initAttributes()) {
|
if (initAttributes()) {
|
||||||
restoreSessions();
|
restoreSessions();
|
||||||
}
|
}
|
||||||
@ -616,6 +616,11 @@ class DeviceActorMessageProcessor extends AbstractContextAwareMsgProcessor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void notifyTransportAboutClosedSessionMaxSessionsLimit(UUID sessionId, SessionInfoMetaData sessionMd) {
|
||||||
|
notifyTransportAboutClosedSession(sessionId, sessionMd, "max concurrent sessions limit reached per device!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void notifyTransportAboutClosedSession(UUID sessionId, SessionInfoMetaData sessionMd, String message) {
|
private void notifyTransportAboutClosedSession(UUID sessionId, SessionInfoMetaData sessionMd, String message) {
|
||||||
SessionCloseNotificationProto sessionCloseNotificationProto = SessionCloseNotificationProto
|
SessionCloseNotificationProto sessionCloseNotificationProto = SessionCloseNotificationProto
|
||||||
.newBuilder()
|
.newBuilder()
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright © 2016-2021 The Thingsboard Authors
|
* Copyright © 2016-2021 The Thingsboard Authors
|
||||||
* <p>
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
* <p>
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* <p>
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user