You need to enable JavaScript to run this app.
Message Queue for RocketMQ

Message Queue for RocketMQ

Copy page
Download PDF
Topic management
Creating topics
Copy page
Download PDF
Creating topics
This topic explains how to create a topic.​
Background information​
In a Message Queue for RocketMQ instance, a topic is the basic unit for sending and receiving messages. Message Queue for RocketMQ uses topics to categorize and manage messages of various types. Producers send messages to a topic, and consumers subscribe to a topic to receive those messages.​
tip​
The topic quota for an instance depends on its specification. For the maximum number of topics supported by each specification, see Product specifications.​
Prerequisites​
  • You have created a RocketMQ instance, and the instance is in the Running state. For more information, see Creating instances.​
  • The instance has at least one available queue.​
  • You cannot create another topic if the maximum number of queues supported by the instance specification has been reached. Delete a topic and try again.​
  • You can configure key permissions when creating a topic. In order to do so, you must first create a key and obtain its access key ID. For more information, see Creating keys.​
Steps​
  1. On the Instance List page, click the instance you want to manage.​
  1. On the Topic Management tab, click Create Topic.​
  1. Configure the basic information for the topic according to the following table.​
  • ​
    Parameter​
    Description​
    Topic name​
    Enter a name for the topic. Naming rules:​
    • The length must be between 3 and 127 characters.​
    • Only letters, numbers, hyphens (-), and underscores (_) are allowed.​
    • The topic name must be unique within each instance. However, topic names can be duplicated across different instances.​
    • The topic name cannot contain any of the following reserved strings or prefixes:​
    • Reserved strings: RMQ_SYS_TRANS_OP_HALF_TOPIC, BenchmarkTest, TBW102, OFFSET_MOVED_EVENT, SELF_TEST_TOPIC, RMQ_SYS_TRANS_HALF_TOPIC, SCHEDULE_TOPIC_XXXX, and RMQ_SYS_TRACE_TOPIC​
    • Prefixes: rocketmq-broker-, %RETRY%, rmq_sys_, and %DLQ%​
    Queue​
    Specify the number of queues for the topic. This value cannot exceed the number of available queues for the instance. For queue quotas by instance specification, see Product specifications.​
    When creating a topic in a 4.x instance:​
    • The default number of queues for a topic that receives global sequential messages is one.​
    • The default is six queues for topics that receive other message types and instance specifications no higher than n3. For specifications higher than n3, the default is twice the number of broker groups.​
    • We recommend setting the queue count to a multiple of the number of compute nodes. Otherwise, data may be distributed unevenly across brokers. For example, since rocketmq.n3.x2.medium has three compute nodes, use 3, 6, 9, or another number that is a multiple of 3.​
    When creating a topic in a 5.x instance:​
    • The default number of queues for a topic that receives global sequential messages is one.​
    • The default is twice the number of broker groups for topics that receive other message types.​
    • In non-ordered messaging scenarios, the number of queues does not impact performance. Additional queues only increase concurrency for ordered message consumption.​
    tip​
    After creating a topic, you can increase the queue count on the Topic Management tab or the topic details page. For more information, see Configuring the number of topic queues.​
    Describe​
    Provide additional information for the topic. The description can contain 0–256 characters.​
    Message type​
    Select the type of message that the topic receives.​
    • Ordinary message: These messages are suitable for asynchronous decoupling between systems, traffic shaping, log services, cache synchronization across large-scale machine fleets, and real-time computing and analytics.​
    • Transaction message: These messages provide distributed transaction capabilities similar to X/Open XA and help achieve eventual consistency for distributed transactions.​
    • Partition order messages: These messages are partitioned by a sharding key. Messages within a partition are published and consumed in a strict first-in, first-out (FIFO) order, which improves concurrency and overall performance.​
    • Global sequential message: Each topic has one queue, and all messages are published and consumed according to the FIFO principle. If a message is not consumed successfully, the next message is stored in the topic queue.​
    • Delayed messages: These messages are delivered at a specified time after being sent to the Message Queue for RocketMQ server. For example, you can schedule a message to be delivered 30 minutes after it is sent.​
    tip​
    • Each topic can only receive one type of message. Once a topic is created, you cannot change its message type.​
    • A service node failure may temporarily disrupt the order of partition order messages and global sequential messages. Partition order messages may also become disorganized during specification changes and queue extensions.​
    • Delayed messages support custom delays at the millisecond level. The maximum delay is whichever is smaller: three days or three times the message retention period.​
    Key permission​
    Configure custom permissions for each RocketMQ key within the topic. If you do not do this, the keys will retain their default permissions.​
    • To configure permissions in bulk, enable Batch authorization. Then, select multiple keys and configure their custom permissions for the topic.​
    • To configure permissions individually, select a key and configure its custom permissions for the topic.​
    • For example, if the default permission for Key A is Reject and you set its custom permission to Publish, Key A will receive the Publish permission for this topic after it is created.​
    tip​
    • If you want to configure key permissions when creating a topic, but there is no available key, see Creating keys.​
    ​
  1. Click Create.​
Result​
Once the topic is created, the Topic Management tab displays its basic information, including the topic name, queue count, description, message type, and creation time.​
Click a topic name to open its details page. The Basic information section displays the topic name, queue count, description, message type, creation time, and associated instance.​
You can also view consumption details under Queue information and Consumer group information. For more information, see Viewing consumption details.​
​
Last updated: 2026.09.23 10:34:37