This topic describes how to create, delete, and update topics, and view the details of a topic in the Message Queue for Apache RocketMQ console.

Background information

A topic is a first-level identifier that is used to classify messages in Message Queue for Apache RocketMQ. Message Queue for Apache RocketMQ supports the Publish/Subscribe (Pub/Sub) messaging model. Producers send messages to topics. Consumers subscribe to topics to consume messages.

Usage notes

A topic cannot be used across instances. For example, Topic A created in Instance A is unavailable in Instance B.

Billing

Message Queue for Apache RocketMQ charges you for created topics regardless of whether the topics are in use because the topics occupy resources. We recommend that you delete unnecessary topics at the earliest opportunity. For more information, see Pricing details about the messaging feature.

Naming rules for topics

  • A topic name must be 3 to 64 characters in length and can contain letters, digits, hyphens (-), and underscores (_).
  • If the instance where a topic resides has a namespace, the name of the topic must be unique in the instance. Specifically, the name cannot be the same as an existing topic name or group ID in the instance. Topic names and group IDs in different instances can be the same. For example, a topic name in Instance A can be the same as a topic name or group ID in Instance B.
  • If the instance where a topic resides has no namespace, the name of the topic must be globally unique across instances and regions. Specifically, the name of the topic cannot be the same as an existing topic name or group ID in Message Queue for Apache RocketMQ within your Alibaba Cloud account.
Note You can check whether an instance has a namespace in the Basic Information section on the Instance Details page in the Message Queue for Apache RocketMQ console.

Create a topic

  1. Log on to the Message Queue for Apache RocketMQ console.
  2. In the left-side navigation pane, click Instances.
  3. In the top navigation bar, select a region, such as China (Hangzhou).
  4. On the Instances page, click the name of the instance that you want to manage. The Instance Details page appears.
  5. In the left-side navigation pane, click Topics.
  6. On the Topics page, click Create Topic.
  7. In the Create Topic panel, set the Name, Description, and Message Type parameters and click OK. Create a topic
    On the Topics page, you can view the topic that you have created.
Notice A topic can send or receive messages only of the specified type. For example, if you specify a topic to send or receive regular messages, the topic cannot send or receive ordered messages. For more information, see Overview of features.

Delete a topic

Notice After you delete a topic, the producers stop sending messages to the topic, and the consumers stop consuming messages from the topic. The metadata and messages of the topic are also deleted and cannot be recovered. Therefore, exercise caution when you delete a topic.
  1. Log on to the Message Queue for Apache RocketMQ console.
  2. In the left-side navigation pane, click Instances.
  3. In the top navigation bar, select a region, such as China (Hangzhou).
  4. On the Instances page, click the name of the instance that you want to manage. The Instance Details page appears.
  5. In the left-side navigation pane, click Topics.
  6. On the Topics page, find the topic that you want to delete, click More in the Actions column, and then select Delete from the drop-down list.
  7. In the message that appears, click OK.
    On the Topics page, you can no longer view the topic that you have deleted.

Update a topic

  1. Log on to the Message Queue for Apache RocketMQ console.
  2. In the left-side navigation pane, click Instances.
  3. In the top navigation bar, select a region, such as China (Hangzhou).
  4. On the Instances page, click the name of the instance that you want to manage. The Instance Details page appears.
  5. In the left-side navigation pane, click Topics.
  6. On the Topics page, find the topic that you want to update and click Details in the Actions column. The Topic Details page appears.
  7. In the Basic Information section, click Edit next to Topic Description. Modify the description of the topic in the field and click OK. Update a topic
    On the Topics page, you can view the new description of the topic.

View the details of a topic

  1. Log on to the Message Queue for Apache RocketMQ console.
  2. In the left-side navigation pane, click Instances.
  3. In the top navigation bar, select a region, such as China (Hangzhou).
  4. On the Instances page, click the name of the instance that you want to manage. The Instance Details page appears.
  5. In the left-side navigation pane, click Topics.
  6. On the Topics page, find the topic whose details you want to view and click the topic name or click Details in the Actions column.
    On the Topic Details page, you can view the details of the topic.

Perform other operations

On the Topics page, you can perform other related operations.

On the Topics page, find the topic that you want to manage, click More in the Actions column, and then select one of the following options from the drop-down list:
  • Quick Start: Send and receive messages in the console.
  • Permissions Reference: View the policies for topic management in the Message Queue for Apache RocketMQ console. For more information, see Policies.
  • Online Groups: View the online groups that subscribe to the topic.
  • Cloud Monitor: View the monitoring data of message production or consumption in the topic.
  • Message Production Chart: View the total number of produced messages in the topic. You can also view the capacity of message production in the unit of transactions per second (TPS).
  • Message Consumption Chart: View the total number of messages that the topic sends to its online groups. You can also view the capacity of message delivery in the unit of TPS.
  • Query Messages: Create a query task to query the messages within the topic. For more information, see Query messages.

References

You can call the following API operations to manage topics: