A Critique of MQTT From a Software Architect
Most people would say that the MQTT has proven to be fairly successful as a lightweight messaging protocol. It is often boasted about for it's small code footprint and limited bandwidth usage, which has led to a growing adoption of MQTT from developers creating Internet of Things (IoT) solutions. Next to CoAP, it's probably the most talked about of the messaging protocols in the space right now. However, Clemens Vasters, a Microsoft architect, wasn't so pleased when he sat down to write an implementation of MQTT 3.1.1.
Vasters writes about the topic at great length and he is nothing short of incredibly, incredibly thorough . His lengthy critique tops off at over 9500 words. I don't think anyone can accuse him of not doing his research. He starts off his critique by explaining why he chose not to use Paolo Patierno's existing M2Mqtt client library which I can only assume would have saved him a lot of time . Among his reasons for passing it up was a difference in server implementation, but also just a desire to better understand the MQTT protocol.
He starts off with a bit of a summary of what he will ultimately conclude many thousands of words later:
He also has a few harsh words for IBM on their role in the message queuing information trade, accusing them of trying to gain face by pretending to be a "open-protocol champions" while they keep the MQ wire protocol on lockdown. Vasters is pretty straightforward though that he considers IBM a competitor, and you may have to take his word at face value. It's interesting to note that he really only talks about IBM as an implementor of early MQTT, whereas it's pointed out in the comments of his blog that Eclipse has has also had quite a bit invested in the protocol.
MQTT is not a messaging protocol; I would call it a funnel protocol serving to move binary frames of data, preferably from constrained clients into data collection systems. It's too limited for actual messaging work, which requires message metadata that a broker can work with. It is doing reasonably well at a very, very narrow set of use-cases and it is terrible at everything that goes beyond those use-cases. What it's reasonably good at is best-effort, raw-data ingestion from clients and best-effort raw-data delivery to clients using a solicit-push pattern (I'll have an explanation later). And as it turns out, the things MQTT is good at can be done in much simpler ways, while retaining more flexibility at the same time.
He comes to a number of conclusions, but primary amongst them is that MQTT is just not the protocol that everyone wants it to be:
MQTT is an old, recycled, and often weirdly inconsistent mess. It's not a good protocol, and certainly not a good protocol for the Internet of Things where we will look connect devices with long-haul links with unpredictable network conditions, and I believe it's unfixable without becoming something different entirely. We ought to know better, and OASIS also ought to know better.More than a couple of people have come out with responses to Vasters' critique, including a well-written response from Tim Kellogg at 2lemetry .