Scenario
Topic in RocketMQ is a core concept for publishing and subscribing to messages. A topic is a message classification or label and helps users to classify and manage associated messages.
l In RocketMQ, message senders publish messages by specifying a topic, while message consumers receive messages by subscribing to the topic. A topic can consist of multiple message producers and consumers. The producer sends messages to the topic, and the consumer can subscribe to the topic and consume the messages.
l The administrator or application developer of RocketMQ creates and manages topics. When creating a topic, you need to specify the name of the topic and set properties such as the topic storage policy and the message expiration time. A topic name should clearly express the meaning or purpose of associated messages.
l Topics are flexible and scalable in RocketMQ. You can create multiple topics based on your business need. Each topic handles messages of different types or in different business scenarios. You can design and manage topics properly for efficient message delivery and flexible message routing.
To sum up, topics are an important concept in RocketMQ for classifying and managing messages. With topics, RocketMQ enables efficient message publish and subscription to help developers manage and organize messages more efficiently.
Topic List
1. Go to the topic management menu to view the topic list. If the list is empty, create a topic. For details about how to create a topic, see specific operation steps.
2. You can query by cluster, broker and topic. Select the query content from the drop-down menu or enter the query information. Click Query to show the required topic data.
3. You can view topic information including topic name, broker name, read queue number, write queue number, permissions, and whether it is ordered. Topic permissions include read-write, read-only, and write-only.
Topic Details
It displays statistics for the current topic, queue distribution, consumer groups, and producer groups.
1. Queue information
It shows the distribution of queues for the topic, including the number of producers in each queue and the number of consumers in the specified consumer group. CONSOLE_INNER_QUEUE_GROUP means it is not consumed.
You can click Offset Query to find the message in the queue corresponding to the offset.
You can click View to view the content of the message package body and whether it is consumed.
The message creation time indicates the time when a message is generated on the client, and the message storage time indicates the time when a message is stored on the RocketMQ server.
2. Consumer group
It refers to the list of consumer groups that are connecting to this topic.
Click Connect Instance to view the list of online instances for the consumer group.
Two consumption modes are supported:
CONSUME_PASSIVELY: indicates push consumption mode
CONSUME_ACTIVELY: indicates pull consumption mode
3. Producer group
It refers to the list of producer groups that are connecting to this topic. Click Connect Instance to view the list of online instances for the producer group.
Routing
It shows the distribution of the queues of the topic, that is, on which brokers the queues are distributed.
The queue distribution of RocketMQ is determined by the broker and topic configurations. In RocketMQ, each topic can consist of multiple queues, and each queue can be supported by multiple brokers.
The distribution of queues is determined by the following factors:
l Broker configuration: In RocketMQ, each broker has a unique name and can be identified by name for configuration. When creating a topic, you can specify the number of message queues and the distribution policy. The distribution policy can be a fixed one or dynamically assigned according to certain rules.
l Topic configuration: When creating a topic, you can specify the number of queues and the distribution policy. The distribution policy can be assigned based on the fixed number or dynamically assigned according to certain rules. For example, you can evenly distribute message queues across brokers, or route messages to different queues based on properties.
l Load balancing policies: RocketMQ provides multiple load balancing policies to evenly distribute message queues in a broker cluster. You can dynamically adjust the load balancing policy based on factors such as broker load and network latency for balanced distribution and efficient processing of message queues.
To sum up, the queue distribution of RocketMQ is determined by the broker and topic configurations and the load balancing policy. You can properly configure the load balancing policy to achieve balanced distribution and efficient processing of message queues, and improve the performance and scalability of message systems.
Export
Export the configuration and routing information of the selected topic as an excel file.
Note:
If you have selected a topic, the system exports the information of the selected topic. If you have not selected a topic, the system exports all topic information under the selected broker of the cluster.
Accumulation Volume
It shows the consumer groups that consume the messages of the topic and the number of unconsumed messages in the consumer groups.
You can click Offset Query to find the message in the queue corresponding to the offset.
TPS Monitoring displays the production and consumption TPS trends of a specified topic.