Creating a Topic
Scenario
A topic is the basic unit for sending and receiving messages. After purchasing a RocketMQ instance, you must manually create topics before creating and retrieving messages.
Prerequisites
A RocketMQ instance has been purchased.
Procedure
- Log in to the console.
- Click
in the upper left corner to select a region.
NoteSelect the region where your RocketMQ instance is located.
- Click
and choose Application > Distributed Message Service for RocketMQ to open the console of DMS for RocketMQ.
- Click a RocketMQ instance to go to the instance details page.
- In the navigation pane, choose Topics.
- Click Create Topic.
- Configure the topic name and other parameters by referring to Table 1 or Table 2.
Table 1 Topic parameters (RocketMQ 4.8.0) Parameter
Description
Topic Name
Name of the topic.
A topic name must meet the following requirements:
- Contains 3 to 64 characters.
- Contains only letters, digits, percent signs (%), vertical bars (|), hyphens (-), and underscores (_).
- Cannot start with rmq_sys_.
- Cannot be the same as the following strings:
- TBW102
- SCHEDULE_TOPIC_XXXX
- BenchmarkTest
- RMQ_SYS_TRANS_HALF_TOPIC
- RMQ_SYS_TRACE_TOPIC
- RMQ_SYS_TRANS_OP_HALF_TOPIC
- TRANS_CHECK_MAX_TIME_TOPIC
- SELF_TEST_TOPIC
- OFFSET_MOVED_EVENT
The topic name must be unique. Otherwise, the topic cannot be created.
Once the topic is created, you cannot modify its name.
NOTE:A percent (%) or vertical bar (|) contained in a topic name will be converted to an underscore (_) by Cloud Eye. For example, if a topic name is test%01, it will be displayed as test_01 on Cloud Eye.
Permission
Topic permission, which can be publish/subscribe, publish, or subscribe.
Brokers
Specify the broker to create the topic on, and the number of queues in the topic.
If the instance is deployed on multiple brokers, click Add to add more brokers and specify queues.
Description
Topic description.
0–200 characters
Table 2 Topic parameters (RocketMQ 5.x) Parameter
Description
Topic Name
Name of the topic.
A topic name must meet the following requirements:
- Contains 3 to 64 characters.
- Contains only letters, digits, percent signs (%), vertical bars (|), hyphens (-), and underscores (_).
- Cannot start with rmq_sys_.
- Cannot be the same as the following strings:
- TBW102
- SCHEDULE_TOPIC_XXXX
- BenchmarkTest
- RMQ_SYS_TRANS_HALF_TOPIC
- RMQ_SYS_TRACE_TOPIC
- RMQ_SYS_TRANS_OP_HALF_TOPIC
- TRANS_CHECK_MAX_TIME_TOPIC
- SELF_TEST_TOPIC
- OFFSET_MOVED_EVENT
The topic name must be unique. Otherwise, the topic cannot be created.
Once the topic is created, you cannot modify its name.
Message Type
Options: Normal, Ordered, Scheduled, and Transactional.
Description
Topic description.
0–200 characters
Figure 1 Creating a topic (RocketMQ 4.8.0)
Figure 2 Creating a topic (RocketMQ 5.x)
- Click OK.
- Scenario
- Prerequisites
- Procedure