各個Iot Cloud對MQTT協議的支持


1. Aliyun

目前物聯網平台支持MQTT標准協議接入,兼容5.0、3.1.1和3.1版本協議,具體的協議請參見MQTT 5.0、MQTT 3.1.1和 MQTT 3.1協議文檔。

  • 與標准MQTT的區別
  • 支持MQTT的PUB、SUB、PING、PONG、CONNECT、DISCONNECT和UNSUB等報文。
  • 支持clean session。
  • 不支持will、retain msg。
  • 支持QoS 0、QoS 1,不支持QoS 2。
  • 不支持SUB QoS,消息QoS以發送方(PUB)指定為准。
  • 基於原生的MQTT Topic上支持RRPC同步模式,服務器可以同步調用設備並獲取設備回執結果

官方鏈接

2. Azure

IoT 中心允許設備通過以下方式與 IoT 中心設備終結點通信:

  • 在端口 8883 上使用 MQTT v3.1.1

  • 在端口 443 上使用基於 WebSocket 的 MQTT v3.1.1。

IoT 中心不是功能完備的 MQTT 中轉站,並未支持 MQTT v3.1.1 標准中指定的所有行為。 本文介紹設備如何使用受支持的 MQTT 行為來與 IoT 中心通信。

  • 可設置的客戶端最大 keep-alive 值為 1767 / 1.5 = 1177 秒。 任何流量都將重置 keep-alive。 例如,成功的 SAS 令牌刷新會重置 keep-alive。
  • 成功建立連接后,設備可以使用 devices/{device_id}/messages/events/ 或 devices/{device_id}/messages/events/{property_bag} 作為 主題名稱 將消息發送到 IoT 中心。
  • IoT 中心不支持 QoS 2 消息。 如果設備應用使用 QoS 2 發布消息,IoT 中心將斷開網絡連接。
  • IoT 中心不會保存 Retain 消息。 如果設備在 RETAIN 標志設置為 1 的情況下發送消息,則 IoT 中心會在消息中添加 mqtt-retain 應用程序屬性 。 在此情況下,IoT 中心不會存儲保留消息,而將其傳遞到后端應用。
  • IoT 中心僅支持每個設備一個活動 MQTT 連接。 代表相同設備 ID 的任何新 MQTT 連接都會導致 IoT 中心刪除現有連接,系統會將“400027 ConnectionForcefullyClosedOnNewConnection”記錄到 IoT 中心日志中。
  • 若要從 IoT 中心接收消息,設備應使用 devices/{device_id}/messages/devicebound/# 作為 主題篩選器 來進行訂閱。 主題篩選器中的多級通配符 # 僅用於允許設備接收主題名稱中的其他屬性。

官方鏈接

3. AWS

  • AWS IoT supports MQTT quality of service (QoS) levels 0 and 1 only. AWS IoT doesn't support publishing or subscribing with QoS level 2. When QoS level 2 is requested, the message broker doesn't send a PUBACK or SUBACK.
  • In AWS IoT, subscribing to a topic with QoS level 0 means that a message is delivered zero or more times. A message might be delivered more than once. Messages delivered more than once might be sent with a different packet ID. In these cases, the DUP flag is not set.
  • When responding to a connection request, the message broker sends a CONNACK message. This message contains a flag to indicate if the connection is resuming a previous session.
  • Before sending additional control packets or a disconnect request, the client must wait for the CONNACK message to be received on their device from the AWS IoT message broker.
  • When a client subscribes to a topic, there might be a delay between the time the message broker sends a SUBACK and the time the client starts receiving new matching messages.
  • The MQTT specification provides a provision for the publisher to request that the broker retain the last message sent to a topic and send it to all future topic subscribers. AWS IoT doesn't support retained messages. If a request is made to retain messages, the connection is disconnected.
  • The message broker uses the client ID to identify each client. The client ID is passed in from the client to the message broker as part of the MQTT payload. Two clients with the same client ID can't be connected concurrently to the message broker. When a client connects to the message broker using a client ID that another client is using, the new client connection is accepted and the previously connected client is disconnected.
  • On rare occasions, the message broker might resend the same logical PUBLISH message with a different packet ID.
  • The message broker doesn't guarantee the order in which messages and ACK are received.

官方鏈接


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM