Hello dear MQTT community,
I recently had an interesting discussion with a colleague about MQTT message ordering while implementing a low-level MQTT 3.1.1 client. The MQTT 3.1.1 specification does not say anything about an in-flight windows, in contrast to MQTT 3.1 when it comes to message ordering (see [1] and [2]). My understanding of the passages is, that MQTT 3.1.1 has a default in-flight window of 1 *for every single topic*, while MQTT 3.1 has a *global* in-flight window (with no size recommendation).
This makes it certainly very easy for 3.1.1 clients to handle async publishes with QoS 1 and 2 but I find this major change rather confusing, especially if it comes to MQTT 3.1.1 compliance, since a good MQTT API would need to have the ability to define “unordered” topics somehow.
After checking a few implementations, I noticed, that MQTT 3.1.1 clients like Eclipse Paho (at least the Java lib) define a global in-flight window and not a per-topic window. Actually, every implementation I checked does something similar and does ignore the fact that there are ordered topics. I’m aware of the fact that the spec explicitly states that the server must treat each topic as ordered topic but in my understanding this should also be applied to clients (when it comes to resends; see the client resend rules in the spec), because the resend rules for clients are de-factor topic in-flight windows of 1.
So my question is: How did other people solve the ordered vs unordered topic challenge, especially when it comes to client API design. Is there even any client library out there which implements the MQTT 3.1.1 spec in regards to the message ordering correctly? Or am I just misunderstanding a key aspect of the 3.1.1 spec?
All the best,
Dominik