Commit b502a1951774a3c186a422e28fe68e7e2f5c0d29
1 parent
44b94f39
Fixed device disconnect behaviour for gateway
Showing
2 changed files
with
2 additions
and
4 deletions
... | ... | @@ -25,10 +25,7 @@ import io.netty.handler.codec.mqtt.*; |
25 | 25 | import org.thingsboard.server.common.data.Device; |
26 | 26 | import org.thingsboard.server.common.data.id.SessionId; |
27 | 27 | import org.thingsboard.server.common.data.kv.KvEntry; |
28 | -import org.thingsboard.server.common.msg.core.AttributesUpdateNotification; | |
29 | -import org.thingsboard.server.common.msg.core.GetAttributesResponse; | |
30 | -import org.thingsboard.server.common.msg.core.ResponseMsg; | |
31 | -import org.thingsboard.server.common.msg.core.ToDeviceRpcRequestMsg; | |
28 | +import org.thingsboard.server.common.msg.core.*; | |
32 | 29 | import org.thingsboard.server.common.msg.kv.AttributesKVMsg; |
33 | 30 | import org.thingsboard.server.common.msg.session.*; |
34 | 31 | import org.thingsboard.server.common.msg.session.ex.SessionException; | ... | ... |
... | ... | @@ -90,6 +90,7 @@ public class GatewaySessionCtx { |
90 | 90 | String deviceName = checkDeviceName(getDeviceName(msg)); |
91 | 91 | GatewayDeviceSessionCtx deviceSessionCtx = devices.remove(deviceName); |
92 | 92 | if (deviceSessionCtx != null) { |
93 | + processor.process(SessionCloseMsg.onDisconnect(deviceSessionCtx.getSessionId())); | |
93 | 94 | deviceSessionCtx.setClosed(true); |
94 | 95 | } |
95 | 96 | ack(msg); | ... | ... |