Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MQTT vs. XMPP Which Should I Choose? [closed]

Overview

I am sending messages back and forth between a client (Android phone) and a Server (Windows Server). Using a persistent connection over TCP, which protocol would be the best solution. I am looking at performance, scalability, size of messages, and battery life. The messages must arrive at the destination in order and can not be duplicates.

MQTT

This seems like the better solution, but there seems to be little examples of large implementation with lots of users. I am not sure if I can integrate this into the windows server, or if it would have to be another application or server running. Finally there seems to be a lack of information on it in general.

XMPP

This seems to have lots of implementation, examples, and even a book : ). However the main purpose seems to be for instant messaging clients and things like Google talk. Will this be an optimal solution to messaging between server and client. I know currently XMPP is mostly used in client to server to client architectures.

Please correct me if I am wrong and thanks in advance for any guidance.

like image 659
Scott Avatar asked Aug 20 '11 05:08

Scott


People also ask

Which is the weakness of XMPP?

Drawbacks or disadvantages of XMPP protocol ➨It does not have QoS mechanism as used by MQTT protocol. ➨Streaming XML has overhead due to text based communication compare to binary based communication. ➨XML content transports asynchronously. ➨Server may overload with presence and instant messaging.

Is MQTT good for chat?

There's no denying that MQTT can be the best option for your chat app development too. It requires little implementation efforts and is the most ideal for machine-to-machine communication. It also allows efficient transmission of data and is a good choice for networks that experience different levels of latency.

Who still uses XMPP?

Apple uses XMPP to deliver push notifications to client devices. Reliable and traceable Push Notification service on dedicated XMPP channel for Android/iOS/Windows.

Which is better MQTT or HTTP?

They both run over TCP connections, and are both client-server in architecture, but MQTT allows messages to pass in both directions between clients and servers whereas HTTP servers only respond to requests from clients.


2 Answers

It depends on what you are trying to do and what hardware you are running.

MQTT has very low keep-alive traffic. XMPP is a an IM protocol, and has a much, much higher overhead in handling presence messages between all the clients.

If you have a small memory footprint constraint, then having to handle the XML parser may make the use of XMPP impossible.

Keep in mind that MQTT stands for Message Queue Telemetry Transport, i.e., it is a transport protocol and does not define the message format at all - you will have to supply this; XMPP is an Instant Messaging protocol which carefully defines all the message formats and requires that all messages be in XML.

In addition to all this: MQTT is a publish subscribe protocol, XMPP is an instant messaging protocol that can be extended (using XEP-0060) to support publish subscribe. You need to consider this when you architect your system.

We are finding MQTT to be the quiet achiever. Your milage might be different.

It all depends ...

Track down the recent announcement by LinkedIn where they discuss their use of MQTT in their mobile app.

Cheers Mark

(BTW Andy was slightly off in his reference to us. We are at Centre for Educational Innovation & Technology (CEIT), The University of Queensland, Brisbane, Australia)

like image 120
Mark Schulz Avatar answered Sep 23 '22 08:09

Mark Schulz


I think that in short the MQTT advantages over XMPP are:

  • Throughput capacity: less overhead, more lightweight
  • Binary vs plain text
  • QoS in place (Fire-and-forget, At-least-once and Exactly-once)
  • Pub/Sub in place (XMPP requires extension XEP- 0060)
  • No need for an XML parser
like image 39
Teixi Avatar answered Sep 20 '22 08:09

Teixi