Message Queuing Telemetry Transport (MQTT) is a messaging protocol that is based on the publish-subscribe (pub/sub) model. In MQTT, each message belongs to a topic. MQTT supports multiple levels of topics. A level 1 topic is a parent topic. Before you use ApsaraMQ for MQTT, you must create a parent topic in the ApsaraMQ for MQTT console.
Usage notes
Topics cannot be used across instances. For example, you cannot use the endpoint of Instance B to subscribe to a topic that is created on Instance A.
A topic name must be 3 to 64 characters in length and can contain letters, digits, hyphens (-), and underscores (_).
Create a topic
Log on to the ApsaraMQ for MQTT console. In the left-side navigation pane, click Instances.
In the top navigation bar, select the region where the instance that you want to manage resides. On the Instances page, click the instance name to go to the Instance Details page.
- In the left-side navigation pane, click Topics. In the upper-left corner of the Topics page, click Create Topic.
- In the Create Topic panel, set the Name and Description parameters for the topic and click OK in the lower-left corner.
Delete a topic
- Go to the Topics page.
- In the topic list, find the topic that you want to delete. In the Actions column, choose .
- In the dialog box that appears, click OK.
Update the description of a topic
- Go to the Topics page.
- In the topic list, find the topic that you want to update and click the topic name.
- In the Basic Information section of the Topic Details page, click Edit next to Description. Modify the description of the topic in the field and click OK.
Query the details of a topic
- Go to the Topics page.
- In the topic list, find the topic that you want to query. Click the topic name to go to the Topic Details page.
References
You can also create data inbound or outbound rules for topics. For more information, see Manage rules.
After you create a topic and a group on an ApsaraMQ for MQTT instance, you can send and receive messages. For more information, see Use ApsaraMQ for MQTT SDKs for Java to implement messaging between ApsaraMQ for MQTT clients and backend service applications.