Browse Source

sparkplug: fix_bug close session after connect nodde - 2

pull/15987/head
nickAS21 1 month ago
parent
commit
2aded56324
  1. 3
      common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/AbstractGatewaySessionHandler.java

3
common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/AbstractGatewaySessionHandler.java

@ -846,8 +846,7 @@ public abstract class AbstractGatewaySessionHandler<T extends AbstractGatewayDev
}
if (msgId <= 0) {
if (deviceSessionCtx.isSparkplug()) {
// Sparkplug devices may use msgId = 0 during the initial connection or for QoS 0 messages.
// We bypass the MALFORMED_PACKET check to allow these sessions to proceed.
// Sparkplug devices may use msgId = 0 during the initial connection or for QoS 0 messages. We bypass the MALFORMED_PACKET check to allow these sessions to proceed.
log.trace("[{}] Sparkplug session: allowed msgId [{}] for device: [{}]", sessionId, msgId, deviceName);
} else {
// Standard MQTT defense: close session for invalid message IDs

Loading…
Cancel
Save