All Products
Search
Document Center

ApsaraMQ for MQTT:Changes in the messaging process

Last Updated:Sep 05, 2024

ApsaraMQ for MQTT V3.x.x does not depend on ApsaraMQ for RocketMQ for data storage. Therefore, the messaging process in ApsaraMQ for MQTT V3.x.x is different from the messaging process in ApsaraMQ for MQTT V2.x.x.

ApsaraMQ for MQTT V2.x.x depends on ApsaraMQ for RocketMQ for message storage. Messages in ApsaraMQ for MQTT are interconnected with messages in ApsaraMQ for RocketMQ. After you create a topic, you can use the SDKs of ApsaraMQ for RocketMQ and ApsaraMQ for MQTT for data exchange.

Due to independent data storage in ApsaraMQ for MQTT V3.x.x, you no longer need to bind an ApsaraMQ for MQTT instance to another service before you use the instance to send and receive messages. To exchange data between ApsaraMQ for MQTT V3.x.x and ApsaraMQ for RocketMQ, you must configure data forwarding rules. The following table describes the differences between the messaging process in ApsaraMQ for MQTT V2.x.x and the messaging process in ApsaraMQ for MQTT V3.x.x in specific scenarios.

Scenario

V2.x.x usage instruction

V3.x.x usage instruction

Send and receive messages by using an ApsaraMQ for MQTT client

Create a topic in the ApsaraMQ for RocketMQ console or by calling the corresponding API operation and then use the topic to send and receive messages.

Create a topic in the ApsaraMQ for MQTT console and then use the topic to send and receive messages.

Send messages by using an ApsaraMQ for MQTT client and receive messages by using an ApsaraMQ for RocketMQ client

  1. Create a topic in the ApsaraMQ for RocketMQ or ApsaraMQ for MQTT console.

  2. Use the topic to send and receive messages.

  1. Create a topic in the ApsaraMQ for MQTT console.

  2. Create a mapped topic in the ApsaraMQ for RocketMQ console. The mapped topic can be different from the topic in ApsaraMQ for MQTT.

  3. Create a data outbound rule to specify the mapping in the ApsaraMQ for MQTT console. For more information, see Manage data outbound rules.

  4. Use the topics to send and receive messages.

Send messages by using an ApsaraMQ for RocketMQ client and receive messages by using an ApsaraMQ for MQTT client

  1. Create a topic in the ApsaraMQ for RocketMQ console or the ApsaraMQ for MQTT console.

  2. Use the topic to send and receive messages.

  1. Create a topic in the ApsaraMQ for MQTT console.

  2. Create a mapped topic in the ApsaraMQ for RocketMQ console. The mapped topic can be different from the ApsaraMQ for MQTT topic.

  3. Create a data inbound rule to specify the mapping in the ApsaraMQ for MQTT console. For more information, see Manage data inbound rules.

  4. Use the topics to send and receive messages.

Receive and process client status notifications by using an ApsaraMQ for RocketMQ client when the status of an ApsaraMQ for MQTT client changes

  1. Create a dedicated topic for client status notifications in the ApsaraMQ for MQTT console.

  2. The status of the ApsaraMQ for MQTT client changes.

  3. Use the ApsaraMQ for RocketMQ client to subscribe to the topic created for client status notifications.

  1. Create a topic used to store client status notifications in the ApsaraMQ for RocketMQ console. No limit is imposed on the format of the topic.

  2. Create a client status notification rule to specify the mapping in the ApsaraMQ for MQTT console. For more information, see Manage rules for client status notifications.

  3. The status of the ApsaraMQ for MQTT client changes.

  4. Use the ApsaraMQ for RocketMQ client to subscribe to the topic used to store client status notifications.