processMsgQueue(ctx);//Under the normal conditions the msg queue will contain 0 messages. Many messages will be processed on device connect event in separate thread pool
log.trace("[{}][{}] Postpone processing msg due to device is not connected. Msg queue size is {}",sessionId,deviceSessionCtx.getDeviceId(),deviceSessionCtx.getMsgQueue().size());
@ -762,6 +797,11 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement
}
deviceSessionCtx.setDisconnected();
}
if(!deviceSessionCtx.getMsgQueue().isEmpty()){
log.warn("doDisconnect for device {} but unprocessed messages {} left in the msg queue",deviceSessionCtx.getDeviceId(),deviceSessionCtx.getMsgQueue().size());
deviceSessionCtx.getMsgQueue().clear();
}
}
@ -779,7 +819,9 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement
msg_queue_size_per_device_limit:"${MQTT_MSG_QUEUE_SIZE_PER_DEVICE_LIMIT:10000}"# messages await in the queue before device connected state. This limit works on low level before TenantProfileLimits mechanism