Operation scenarios
Topic is a core concept in TDMQ for RocketMQ. It is usually used to categorize and manage various messages produced by the system in a centralized manner; for example, messages related to transactions can be placed in a topic named "trade" for other consumers to subscribe to.
In actual application scenarios, a topic often represents a business category. You can decide how to design different topics based on your system and data architectures.
This document describes how to use topics to categorize and manage messages in TDMQ for RocketMQ.
Prerequisites
You have created a namespace.
Operation step
Creating a topic
1. Log in to TDMQ RocketMQ Console, select the region, then click the ID of the target cluster to enter the cluster's basic information page. 2. Click the Topic tab at the top, select the namespace, then click Create to enter the Create Topic page.
3. In the Create Topic dialog, fill in the following information.
Topic Name: Enter the name of the Topic (cannot be modified after creation), 3-64 characters, can only contain letters, digits, "-", and "_"
Type: Select the message type, including Normal, Sequential Messages, Delayed Messages, and Transaction Messages (For more information on message types, see Message Type). Partition Count: Select the number of partitions, with a maximum support of 16 partitions. Using multiple partitions can enhance the production and consumption performance of a single Topic, but cannot guarantee orderliness.
Description: Fill in the topic description
4. Click Submit, and the created Topic will be visible in the Topic list.
Send Test Message
The TDMQ RocketMQ Console supports manual message sending; performing the corresponding operation on the console allows for messages to be sent to specified topics.
1. In the topic list, click Send Test Message in the action column of the target topic.
2. In the pop-up window, enter the Message Key, Message Tag, and message content, then click Submit.
Viewing Topic Details
You can enter the topic detail page to view detailed information about the current topic.
Subscribed Group
1. In the Topic list, click the Topic name or the Topic Details in the action column to enter the topic details page.
2. On the topic details page, you can view the groups that have subscribed to the topic, as well as subscription rules and other information.
Topic Queue Details
Note:
Only dedicated clusters support viewing Topic queue details.
On the topic details page, you can view the queue situation distributed across various Broker nodes under the current topic.
Viewing Producer Information
You can view related information about producers under the current Topic on the Topic details page.
Note:
Only dedicated and generic clusters of TDMQ for RocketMQ 4.x support viewing Topic producer details.
Querying a topic
You can search for topics by topic name in the search box at the top right corner of the Topic list page. TDMQ for RocketMQ will perform fuzzy matching and display the search results.
Editing Topic
1. In the Topic list, find the topic you want to edit, click Edit in the operation bar.
2. In the pop-up dialog box, you can edit the parameters of the topic.
3. Click Submit to complete the editing of the topic.
Deleting Topic
Batch Deletion: In the Topic list, check all the topics you want to delete, click Batch Delete at the top left corner, in the pop-up prompt box, click Delete to complete the deletion.
Single Deletion: In the Topic list, find the topic you want to delete, click Delete in the operation column, in the pop-up prompt box, click Delete to complete the deletion.
Note:
After a topic is deleted, all unconsumed messages retained in it will be cleared; therefore, proceed with caution.
When deleting a single topic or batch deleting topics, the console will verify the data of the current topic, as shown in the following figure.
Metadata Import and Export
Metadata Export
You can directly export metadata from the top right corner of the Topic list page by clicking the button. The metadata is exported in .xlsx format table file. Metadata Import
If you need to load the Topic information from one cluster into another, after exporting the metadata, you can click the button at the top right corner of the Topic list page to import the Topic data into the specified namespace.
Was this page helpful?