Compared with V2.x.x, ApsaraMQ for MQTT of version V3.x.x implements independent data storage without strong dependency on ApsaraMQ for RocketMQ. Therefore, the message publish-subscribe process has changed accordingly.

ApsaraMQ for MQTT V2.x.x is strongly dependent on ApsaraMQ for RocketMQ for message storage. Therefore, ApsaraMQ for MQTT messages are interconnected with those of ApsaraMQ for RocketMQ. After you create a topic, you can use the SDKs of ApsaraMQ for RocketMQ and ApsaraMQ for MQTT for intercommunication.

After ApsaraMQ for MQTT of version V3.x.x adopts independent internal storage, it uses ApsaraMQ for MQTT separately for publishing and subscribing to messages, without needing to configure any other services. However, if you still need data exchanges between ApsaraMQ for MQTT and ApsaraMQ for RocketMQ, you must configure additional data forwarding rules. The following table describes the differences in specific scenarios.

ScenarioV2.x.x usage instructionsV3.x.x usage instructions
The ApsaraMQ for MQTT client publishes and subscribes to messages.The ApsaraMQ for RocketMQ console or API is used to create topics before messages can be published and subscribed to.The ApsaraMQ for MQTT console is used to create topics before messages can be published and subscribed to.
The ApsaraMQ for MQTT client publishes messages, and the ApsaraMQ for RocketMQ client subscribes to messages.
  1. The ApsaraMQ for RocketMQ console or the ApsaraMQ for MQTT console is used to create topics.
  2. Messages are published and subscribed to.
  1. The ApsaraMQ for MQTT console is used to create topics.
  2. The ApsaraMQ for RocketMQ console is used to create mapped topics, which can be different from the topics of ApsaraMQ for MQTT.
  3. The ApsaraMQ for MQTT console is used to create data outbound rules to configure mappings. For more information about the procedure, see Manage data outbound rules.
  4. Messages are published and subscribed to.
The ApsaraMQ for RocketMQ client publishes messages, and the ApsaraMQ for MQTT client subscribes to messages.
  1. The ApsaraMQ for RocketMQ console or the ApsaraMQ for MQTT console is used to create topics.
  2. Messages are published and subscribed to.
  1. The ApsaraMQ for MQTT console is used to create topics.
  2. The ApsaraMQ for RocketMQ console is used to create mapped topics, which can be different from the topics of Message Queue for MQTT.
  3. The ApsaraMQ for MQTT console is used to create data inbound rules to configure mappings. For more information about the procedure, see Manage data inbound rules.
  4. Messages are published and subscribed to.
After the ApsaraMQ for MQTT client goes online or offline, the ApsaraMQ for RocketMQ client consumes and processes the online or offline notifications.
  1. Dedicated topics for online or offline notification purposes are created in the ApsaraMQ for MQTT console.
  2. The ApsaraMQ for MQTT client goes online or offline.
  3. The ApsaraMQ for RocketMQ client is used to subscribe to online or offline notification topics.
  1. Topics for storing notification events are created in the ApsaraMQ for RocketMQ console, without any formatting requirements.
  2. Client status notification rules are created in the ApsaraMQ for MQTT console to configure mappings. For more information about the procedure, see Manage rules for client status notification.
  3. The ApsaraMQ for MQTT client goes online or offline.
  4. The ApsaraMQ for RocketMQ client is used to subscribe to online or offline notification topics.