Getting ready

First, let's recap the three protocols, HTTP, MQTT, AMQP. MQTT protocol works on a publish and subscribe architecture. A MQTT client subscribes to a channel on a server, and when a server receives new information for that channel, it pushes it out to that device.

MQTT provides the QoS feature, which defines the priority for the communication between the device and server. These are:

  • 0: deliver the message once
  • 1: deliver the message at least once
  • 2: deliver the message exactly once

The AMQP is another session layer protocol that runs over TCP and provides a publish/ subscribe architecture which is like that of MQTT.

The difference between AMQP and MQTT is that AMQP creates multiple queues for the subscribers to receive the message. These messages are the telemetry data sent by the publisher.

The message broker supports clients connecting with the HTTP protocol using a REST API. However, HTTP does not have an efficient way to implement the server push, so when you implement HTTP protocol communication for IoT devices you need to poll the cloud-to-device messages from IoT Hub.

Currently with HTTP protocol, each device should poll for messages every 25 minutes or more, which is not the case with the others; they can push messages while receiving.

While designing your IoT solution you should compare these protocols. Let's consider questions which we need to answer to choose the protocol to use for your IoT solution.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.193.232