Mastering Apache RocketMQ: Ports, Commands, and Monitoring Tips
This guide explains the key port configurations of Apache RocketMQ brokers, details essential mqadmin commands for managing topics, checking status, and monitoring consumer progress, and provides practical examples to help administrators efficiently operate and troubleshoot RocketMQ clusters.
RocketMQ Broker Port Configuration
RocketMQ brokers expose several ports, each serving a specific purpose:
10912: Message Transfer Port – Used by producers to push messages to the broker and by consumers to pull messages.
10911: Management Port – Handles communication between the broker and NameServer; brokers register themselves here and clients can query cluster information.
10909: Health Check Port – Provides a monitoring interface for checking broker health and load status.
8080: Web Management Port – Hosts the RocketMQ web console for viewing cluster state, topics, and consumer progress.
8081: Proxy Management Port – Activated when the --enable-proxy flag is set, offering a proxy service for managing proxy requests.
Common RocketMQ Commands
RocketMQ supplies a set of command‑line tools via mqadmin to manage and monitor the cluster.
List all topics: mqadmin topicList -n rmqnamesrv:9876 Displays every topic registered in the cluster, helping you understand the message structure.
Check consumer progress: mqadmin consumerProgress -n rmqnamesrv:9876 Shows the consumption progress of a consumer group, including TPS and current offset, useful for verifying that consumers are operating correctly.
View a specific topic's status:
mqadmin topicStatus -n rmqnamesrv:9876 -t TestTopicReturns the Min Offset, Max Offset, and current state of each queue within the topic, revealing message distribution across the cluster.
Create a topic:
sh mqadmin updatetopic -t TestTopic -c DefaultClusterCreates a new topic, assigns queues, and applies the specified cluster configuration.
Show consumer group details: sh mqadmin consumerProgress -n rmqnamesrv:9876 Outputs information such as consumption mode (PULL), type (CLUSTERING), and other details for the group.
Creating a Topic
To add a new topic in RocketMQ, run the following command:
sh mqadmin updatetopic -t TestTopic -c DefaultClusterThe command registers TestTopic under the DefaultCluster with the NameServer. Successful execution returns configuration details:
create topic to 127.0.0.1:10911 success.
TopicConfig [topicName=TestTopic, readQueueNums=8, writeQueueNums=8, perm=RW-, topicFilterType=SINGLE_TAG, topicSysFlag=0, order=false, attributes={}]The output shows the number of read/write queues, permission settings (RW‑), and whether ordered consumption is enabled.
Viewing Topic Status
After creating a topic, you can inspect its status with:
sh mqadmin topicStatus -c DefaultCluster -t TestTopicSample output:
#Broker Name #QID #Min Offset #Max Offset #Last Updated
f2ed7420dc74 0 0 0
f2ed7420dc74 1 0 0
f2ed7420dc74 2 0 0
f2ed7420dc74 3 0 0
f2ed7420dc74 4 0 0
f2ed7420dc74 5 0 0
f2ed7420dc74 6 0 0
f2ed7420dc74 7 0 0This information lets you see each queue's minimum and maximum offsets, helping assess message consumption progress.
Monitoring Consumer Progress
To monitor how consumers are processing messages, use: sh mqadmin consumerProgress -n rmqnamesrv:9876 Example output:
#Group #Count #Version #Type #Model #TPS #Diff Total
DefaultConsumerGroup 1 1.0.0 PULL CLUSTERING 0.0 0The data shows TPS (transactions per second) and any lag, enabling you to ensure consumers are healthy and keeping up with the message flow.
Conclusion
Understanding RocketMQ's port layout and mastering the essential mqadmin commands empowers administrators to effectively manage, monitor, and troubleshoot clusters, ensuring reliable message delivery and stable operation in production environments.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Ops Development & AI Practice
DevSecOps engineer sharing experiences and insights on AI, Web3, and Claude code development. Aims to help solve technical challenges, improve development efficiency, and grow through community interaction. Feel free to comment and discuss.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
