1. 17

  2. 3

    I’ve heard that MQTT is a nice protocol, but the article here doesn’t entertain any alternatives to MQTT, just a passing mention. Anyone with more experience know why to use MQTT versus other messaging protocols?

    1. 2

      Hi, I’m the author. The reason I didn’t spend much time on the alternatives was (1) I was running out of space (lame, I know, but it’s a reality that authors have to keep in mind) and (2) MQTT is the most promising. My intention was to get devs thinking outside the box of “oh, I’ll just use HTTP” or “oh I’ll just open a TCP socket” and underline the problems with those approaches.

      Many people pointed out that CoAP is an alternative. I plan to write another blog soon that centers around CoAP. It’s an excellent M2M protocol, but it’s more of a lightweight alternative to HTTP since it’s RESTful architecture, not publish/subscribe like MQTT. Also, architectures that use CoAP are typically inverted from what you normally think of with HTTP. All the other pub/sub options that people are using for M2M/IoT aren’t very well suited for the job as compared to MQTT.

      STOMP is immature and rather bulky. AMQ & XMPP are too heavy on the client side. Kafka scales well, but is very heavy on the client side. Then there’s always the option of opening up a raw socket and writing to it; hopefully I’ve talked you down from that one though ;) MQTT fits the domain well because it’s very resource conscious and lets you ignore pesky problems like network disconnects.

      1. 2

        You mention in your comments that XMPP “uses HTTP.” This is incorrect. Yes, we do have extensions for long-polling HTTP, but that is not the primary interface. Also, I would expect to see JSON transforms before too long.

        1. 1

          Thanks, that’s informative. I plan to get my hands deeper into XMPP soon. Maybe then I’ll say less uneducated things about it :)

    2. 2

      Great find. MQTT-SN looks especially interesting, since a lot of embedded systems, like low-power microcontrollers, do not have TCP support out-of-the-box or are not powerful enough to support the overhead of TCP.

      1. 2

        Most people seem to be unaware of sctp, but they rely on it often when they use a cell phone. It’s sort of a cross between udp and tcp but with multi-homing built in. Message oriented but with in-order delivery. People overuse tcp all the time for things sctp would handle much better. Many uses of MQTT would probably be better suited for it than tcp.

        1. 1

          Thanks for the reply. I know nothing of SCTP, but it sounds like I should. At 2lemetry where I work on an MQTT broker, we also accept SMS messages. From my understanding, SMS messages have the same delivery guarantees as SCTP. MQTT-SN runs on datagram protocols - like UDP and SCTP.