Inflight and Queue
When the number of concurrently existing packets in the network exceeds the limit, that is, the length limit of Inflight Window is reached(see ), EMQX Broker will no longer send subsequent messages, but will store these packets in the Message Queue. Once a message is acknowledged in the Inflight Window, the message in the Message Queue will be sent in first-in, first-out order and stored in the Inflight Window.
It should be noted that if the length limit of Message Queue is also reached, subsequent packets will still be buffered to the Message Queue, but the first buffered message in the corresponding message queue will be discarded. If there are QoS 0 messages in the queue, the QoS 0 messages will be discarded first. Therefore, it is very important to configure a suitable Message Queue length limit (see ) according to your actual situation.
The client uses this value to limit the maximum number of published messages with a QoS of1 and a QoS of 2 that the client is willing to process simultaneously. There is no mechanism to limit the published messages with a QoS of 0 that the server is trying to send.
It is not difficult to see that Receive Maximum
is actually the same as the Inflight Window mechanism in EMQX Broker. However, EMQX already provided this function to the accessed MQTT client before the MQTT v5.0 protocol was released. Now, the clients using the MQTT v5.0 protocol will set the maximum length of the Inflight Window according to the specification of the Receive Maximum, while clients with earlier versions of the MQTT protocol will still set it according to the configuration.