IoT Zone is brought to you in partnership with:

Ben is a writer, editor, coffee addict, beer snob, and music lover living in Cary, NC. He first became interested in computer hardware at a young age, and has built more than his fair share of desktop PCs over the years. He's a total device junkie and welcomes the coming age of the Internet of Things. His interest has since spread to tech media in general—in particular he writes about cloud technologies, middleware, DevOps, IoT, and enterprise architecture. He's easy to get a hold of, especially on Twitter, where he keeps an active presence. Get in contact to discuss all things software, whatever your favorite beer is, interesting tech topics... really, just talk about anything. Benjamin is a DZone Zone Leader and has posted 133 posts at DZone. You can read more from them at their website. View Full User Profile

A Critique of MQTT From a Software Architect

06.10.2014
| 7219 views |
  • submit to reddit

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 [1]. 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 [2]. 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:

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 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.

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 [3].

[1] http://vasters.com/clemensv/2014/06/02/MQTT+An+Implementers+Perspective.aspx
[2] http://code.msdn.microsoft.com/windowsdesktop/M2Mqtt-MQTT-client-library-ac6d3858
[3] http://timkellogg.me/blog/2014/06/02/MQTT-another-implementors-perspective/