tencent cloud

Feedback

Topic Management

Last updated: 2022-07-29 18:38:12

    Overview

    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.

    Prerequisites

    You have created a namespace.

    Directions

    Creating a topic

    1. Log in to the TDMQ for Pulsar console and click Topic Management on the left sidebar.
    2. On the Topic Management page, click Create to pop up the Create Topic window.
    3. In the Create Topic window, enter the following information:
      • Topic Name: It cannot be empty and can contain up to 128 digits, letters, and special symbols (-_=:.).
      • Topic Type: Persistent or Non-persistent.
        • 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-persistently stored messages are stored in the broker. Such messages are suitable for stream processing or other scenarios that do not require high data reliability. Such messages cannot be queried and traced.
      • Partition:
        • Pulsar guarantees that messages in a single partition are sequential - that is, if there is only one partition in a topic, messages there are globally sequential.
        • Multi-partition topics have better performance than single-partition topics. To balance performance and sequence, you can use the Key-Shared subscription mode as instructed in Subscription Mode to make messages partitionally sequential. You only need to mark messages that need to be sequential with the same key and deliver them to the same partition.
      • Description: Enter the topic remarks of up to 128 characters.
    4. Click Save, and you can see the created topic in the topic list.
      Parameter Description
      Topic Name The topic name in the format of pulsar-****/namespace/topicName.
      Monitoring Click to view the topic monitoring details. For more information on monitoring metrics, see Viewing Monitoring Data.
      Type The message type, including general, globally sequential, and partitionally sequential. For more information, see Message Type.
      Creator User or System.
      Partition The number of topic partitions.
      Client
      • Producer: It displays the number of producers/the maximum number of producers. Click it to enter the producer details page. For more information, see Producer Management.
      • Consumer: It displays the number of consumers/the maximum number of consumers. Click it to enter the consumer details page. For more information, see Viewing subscription details.
      Note: 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 remarks of the topic.

    Querying a 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 Creator in the topic list.

    Editing a topic

    1. In Topic Management, click Edit in the Operation column of the target topic.
    2. In the pop-up window, you can edit the number of topic partitions (which is 1 for globally sequential messages and cannot be edited) as well as the description.
    3. Click Submit.

    Sending a message

    You can manually send a message to the specified topic in the TDMQ for Pulsar console.

    1. In Topic Management, click Send Message in the Operation column of the target topic.
    2. Enter the message content of up to 64 KB in the pop-up window.
    3. Click Submit to send the message. After the message is sent, it can be consumed by any subscribers to the topic.

    Adding a subscription

    You can manually create a subscription in the TDMQ for Pulsar console.

    1. In Topic Management, click Create Subscription in the Operation column of the target topic.
    2. Enter the subscription name and description in the pop-up window.
    • Subscription Name: It can contain up to 64 characters.
    • Auto-Create Retry & Dead Letter Queue: You can choose whether to automatically create a retry letter topic and a dead letter topic.
    • Description: Enter remarks of up to 200 characters.
    1. Click Submit.
      You can click View Subscription in the Operation column of a topic to view its subscriptions, and the subscription just created will be displayed in the list.
    Note:

    • If you select Auto-Create Retry & Dead Letter Queue, TDMQ for Pulsar will automatically create a retry topic and a dead letter topic, which will be displayed in the topic list as two new topics named "subscription name + RETRY" and "subscription name + DLQ" respectively.
    • For the concepts and usage of retry letter and dead letter topics, see Retry Letter Topic and Dead Letter Topic.

    Deleting a topic

    Note:

    After a topic is deleted, all unconsumed messages retained in it will be cleared; therefore, proceed with caution.

    1. In Topic Management, click More > Delete in the Operation column of the target topic. You can also select multiple topics and click Delete at the top of the topic list.
    2. In the pop-up window, click Submit.
      Force Deletion: After this option is enabled, a topic will be forcibly deleted even if it has subscriptions.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support