A topic is the primary message routing construct in ApsaraMQ for RocketMQ. In the publish/subscribe (pub/sub) model, producers send messages to a topic and consumers subscribe to that topic to receive them. Organize topics by business domain -- for example, one topic for order events, another for logistics updates, and a third for payment notifications.
This page explains how to create, view, update, and delete topics in the ApsaraMQ for RocketMQ console. To manage topics programmatically, see API reference.
Before you begin
An ApsaraMQ for RocketMQ instance is available. To create one, see the instance management documentation.
You have determined the message type for the topic. Each topic supports only one message type, and this setting cannot be changed after creation. For details, see Message types.
Key constraints
Before you create a topic, review the following constraints.
| Constraint | Description |
|---|---|
| Instance-scoped | A topic belongs to one instance and cannot be used across instances. |
| Message type is immutable | The message type you select at creation determines which messages the topic accepts. A mismatch causes O&M issues such as loss of scheduled messages during endpoint changes or instance migration. |
| Billing | Each topic incurs occupancy fees regardless of usage. Delete unused topics to avoid unnecessary charges. For details, see Billing of the messaging feature and Billing. |
Naming rules
A topic name must meet the following requirements:
3 to 64 characters in length
Contains only letters, digits, hyphens (-), and underscores (_)
The uniqueness requirement depends on whether the instance has a namespace:
| Instance type | Uniqueness scope | Details |
|---|---|---|
| With namespace | Within the instance | The name cannot duplicate an existing topic name or group ID in the same instance. Different instances can share names. |
| Without namespace | Across all instances and regions | The name cannot duplicate any existing topic name or group ID in your Alibaba Cloud account. |
Check whether an instance has a namespace in the Basic Information section of the Instance Details page.
Create a topic
Log on to the ApsaraMQ for RocketMQ console. In the navigation pane, click Instances.
In the top navigation bar, select a region, such as China (Hangzhou). Click the name of the instance that you want to manage.
In the navigation pane, click Topics. In the upper-left corner, click Create Topic.
In the Create Topic panel, configure the following parameters, and then click OK.
Parameter Description Name A unique topic name that follows the naming rules. Description A brief description of the topic purpose. Message Type The type of messages that this topic handles. This value cannot be changed after creation.
A topic can only send and receive messages that match its message type. For example, a topic created with the Normal Message type accepts only normal messages. For details, see Message types.

View topic details
On the Instances page, click the name of the instance that you want to manage. In the navigation pane, click Topics.
In the topic list, click the topic name, or click Details in the Actions column.
Update topic description
On the Instances page, click the name of the instance that you want to manage. In the navigation pane, click Topics.
In the topic list, find the target topic and click Details in the Actions column.
In the Basic Information section, click Edit next to the Topic Description field. Enter a new description, and then click OK.

Delete a topic
Deleting a topic is irreversible. After deletion, producers can no longer send messages to the topic, consumers can no longer consume messages from it, and all metadata and messages in the topic are permanently removed.
On the Instances page, click the name of the instance that you want to manage. In the navigation pane, click Topics.
In the topic list, find the target topic, click More in the Actions column, and then select Delete.
In the confirmation dialog box, click OK.
API reference
The following API operations are available for topic management:
| API | Description |
|---|---|
| OnsTopicCreate | Creates a topic. |
| OnsTopicDelete | Deletes a topic. |
| OnsTopicList | Queries topics. |
| OnsTopicStatus | Queries the total message count and last update time of a topic. |
| OnsTopicSubDetail | Queries the subscriptions of a topic. |