The content of this page has been automatically translated by AI. If you encounter any problems while reading, you can view the corresponding content in Chinese.
Topic is a core concept in TDMQ for Pulsar. 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 Pulsar.
2. On the Topic Management page, click Create to open the dialog for creating a new topic.
3. In the New Topic dialog, fill in the following information:
Topic name: Cannot be empty, supports numbers, letters, and symbols "-_=:.", with a length not exceeding 128 characters.
Topic Type: Supports Persistent and Non-persistent types.
Persistent: Persistently stored messages are stored in the disk with multiple replicas to avoid message loss. Such messages are suitable for scenarios that require high data reliability such as financial or business transactions.
Non-persistent: Non-persistent topic messages are not stored on disk and are directly delivered to current online subscriptions. They are deleted upon successful delivery. If there are no online subscriptions, the messages are directly deleted and not retained on the server. This is suitable for scenarios with low data reliability requirements, such as stream processing. Non-persistent messages only support the immediate sending and receiving of general messages and do not support features such as message query, message tracing, delayed messages, message filtering, or message rewinding.
Note:
For a non-persistent topic, enter a complete topic name prefixed with non-persistent:// during message sending and receiving.
Partitioned or not:
Pulsar can ensure ordered messages within a single partition, meaning that if a Topic with 1 partition is created, global ordering can be ensured.
Single-partition topics perform worse than multi-partition topics. To balance performance and orderliness, refer to Subscription Mode and use the Key-Shared mode for consumption to achieve partitionally sequential messages. Mark the same key to ensure that messages needing order fall into the same partition.
Message TTL, which is the TTL at the topic level, defaults to the namespace policy and has a higher priority than namespace TTL. Only supported by professional clusters, existing clusters need to be upgraded for support. Please contact us.
Description: Enter the topic descriptions of up to 128 characters.
4. Click Save, and the created topic will appear in the topic list.
Parameter
Description
Topic Name
The topic name in the format of: pulsar-****/namespace/topicName.
The message type, including general, globally sequential, and partitionally sequential. For more information, see Message Types.
Source of creation
<User created or system created.>
Partition Count
The number of topic partitions.
Message TTL
The expiration time of unconsumed messages. If the message is not acknowledged within the timeout, it will not be processed. This feature is only supported by professional clusters. If needed, please contact us.
Client
Producer: Number of producers/producer cap. Click to go to the producer details page. For more information, see View Producer Details.
Consumer: Displays the number of consumers/consumer cap. Click to go to the consumer detail page. For more information, see View Subscription Details.
Description: When the value is displayed in orange (warning), the fraction has reached 80%. When it is displayed in red (error), the fraction has reached 90%, in which case you need to close unnecessary client connections.
Creation Time
The creation time of the topic.
Description
The topic descriptions.
Querying Topic
You can search for topics by topic name in the search box in the top-right corner of the Topic Management page. TDMQ for Pulsar will perform a fuzzy match and display the search results.
You can also filter topics by Type and Source of creation in the topic list.
Editing Topic
1. In the Topic Management section, locate the topic you want to edit and click More > Edit in the action column.
2. In the popup dialog, you can edit the partition number of the topic (global ordered messages have only 1 partition and cannot be edited) and the description.
3. Click Submit to complete the editing.
Sending Message
You can manually send a message to the specified topic in the TDMQ for Pulsar console.
1. In the Topic Management section, locate the topic you want to send a message to and click Send Message in the action column.
2. Enter the message content in the popup dialog. The message length should not exceed 64KB.
3. Click Submit to send the message. Once sent, the message can be consumed by any subscriber under the topic.
Add a New Subscription
You can manually create a subscription in the TDMQ for Pulsar console.
1. In the Topic Management section, locate the topic you want to create a subscription for and click Add a New Subscription in the action column.
2. Enter the subscription name and description in the popup dialog.
Subscription name: Length should not exceed 128 characters.
Automatic creation of retry & dead-letter queues: You can choose whether to automatically create retry and dead-letter topics.
Description: Should not exceed 200 characters.
3. Click Save to complete the creation.
After creation, you can click on View Subscription in the action column to view the subscriptions for the topic. You will see the newly created subscription in the list.
Description
If you choose automatic creation of retry and dead-letter topics, tdmq for pulsar will automatically create a retry queue and a dead-letter queue for the user, presented as two new topics in the topic list. The topic is named:
2.9.2 Version Cluster: [Topic Name]-[Subscription Name]-RETRY
After a topic is deleted, all unconsumed messages retained in it will be cleared; therefore, proceed with caution.
1. In the Topic Management section, locate the topic you want to delete and click More > Delete in the action column, or select multiple topics and then click Delete at the top of the topic list.
2. In the pop-up window, click Delete to complete the deletion.
Force Deletion: After this option is enabled, the topic will be forcibly deleted even if it has subscriptions.