Marconi
Marconi

Reputation: 3651

How MQTT saves battery and supports limited network connectivity?

I've been reading about MQTT and I understand it uses TCP for network transport. So if I have a mobile app that will send subscribe request, I presume this will be an full-duplex connection so the client can be notified for incoming pushed data.

How then is this more battery and network efficient? I mean you still established an open TCP connection. Also how does it handle disconnection, does it auto-reconnect to the broker?

Upvotes: 3

Views: 2202

Answers (1)

hardillb
hardillb

Reputation: 59618

Taking into account my comment on the question, assuming you want to compare to HTTP Long polling these 2 links may help to answer your question:

https://www.ibm.com/developerworks/community/blogs/sowhatfordevs/entry/using_mqtt_protocol_advantages_over_http_in_mobile_application_development5?lang=en

http://stephendnicholas.com/archives/1217

TL;DR version:

The message sizes tend to be significantly smaller with MQTT vs HTTP (especially when you take into account all the http headers that get sent), this saves on network usage and in turn battery usage.

As for the reconnect side of things, the client libraries do not automatically reconnect but they do trigger a call back when the connection drops so you can handle reconnecting as required.

Upvotes: 4

Related Questions