RocketMQ-Rust Admin CLI
A powerful command-line interface for managing both RocketMQ-Rust and Apache RocketMQ clusters, implemented in Rust. This is the Rust implementation of Apache RocketMQ Tools, providing a fast, safe, and ergonomic CLI experience with full compatibility for both platforms.
📖 Overview
rocketmq-admin-cli is a comprehensive admin tool that provides full management capabilities for RocketMQ clusters, including:
- Topic Management: Create, update, delete, and query topics
- Consumer Management: Manage consumer groups and monitor consumption
- NameServer Operations: Query and manage NameServer metadata
- Controller Operations: Interact with RocketMQ controllers
- ACL/Auth Management: Manage access control and authentication
This CLI tool is built on top of rocketmq-admin-core, which provides the core business logic.
✨ Features
- 🚀 High Performance: Built with Rust for blazing-fast execution
- 🛡️ Type Safety: Leverages Rust's type system to prevent errors
- 📝 Rich Output Formats: Support for Table, JSON, YAML output
- 🔧 Auto-completion: Shell completion for Bash, Zsh, Fish
- 💡 Intuitive Commands: Well-organized command hierarchy
- 🔄 Compatible: Implements all Apache RocketMQ Tools commands
- ⚡ Async Runtime: Built on Tokio for efficient I/O operations
📦 Installation
Prerequisites
- Rust 1.75 or higher
- A running RocketMQ cluster (NameServer + Broker)
Build from Source
# Clone the repository
# Build the CLI tool
# The binary will be available at:
# target/release/rocketmq-admin-cli
Install via Cargo
🚀 Quick Start
Basic Usage
# Show help information
# Show all available command categories
# Topic commands help
Common Operations
Topic Management
# List all topics
# Get topic cluster list
# Get topic route information
# Create/Update topic
# Delete topic
Consumer Management
# Query consumer group information
# Get consumer connection
# Get consumer status
# Update subscription group
# Delete subscription group
NameServer Operations
# Get KV config
# Update KV config
# Delete KV config
# Wipe write permission
# Add write permission
Controller Operations
# Get controller configuration
# Update controller configuration
# Get controller metadata
ACL/Auth Management
# Get all ACL configuration
# Get user ACL
# Update ACL
|
# Delete ACL
📋 Command Categories
The CLI organizes commands into logical categories:
| Category | Description | Example Commands |
|---|---|---|
| topic | Topic management operations | topicList, updateTopic, deleteTopic, topicRoute, topicStatus |
| consumer | Consumer group management | consumerProgress, consumerConnection, updateSubGroup, deleteSubGroup |
| nameserver | NameServer operations | getKVConfig, updateKVConfig, deleteKVConfig, wipeWritePerm |
| controller | Controller management | getControllerConfig, updateControllerConfig, getControllerMetadata |
| auth | ACL and authentication | getAcl, getUserAcl, updateAcl, deleteAcl, copyAcl |
View All Command Categories
# Show categorized command table
🔧 Advanced Features
Shell Completion
Generate shell completion scripts for better command-line experience:
# Bash
# Zsh
# Fish
Environment Variables
You can set the NameServer address via environment variable:
# Set default NameServer address
# Now you can omit -n flag
Skip Confirmation Prompts
For dangerous operations (like delete), use -y or --yes to skip confirmation:
# Delete topic without confirmation
Output Formatting
Control output format with appropriate flags (implementation may vary by command):
# JSON output (if supported)
# YAML output (if supported)
# Table output (default)
🏗️ Architecture
┌─────────────────────────────────────────┐
│ rocketmq-admin-cli (binary) │
│ - CLI entry point (main.rs) │
│ - Command-line argument parsing │
└─────────────────┬───────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ rocketmq-admin-core (library) │
│ - Core business logic │
│ - Command implementations │
│ - Output formatters │
└─────────────────┬───────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ rocketmq-client (library) │
│ - DefaultMQAdminExt │
│ - MQAdminExt trait │
│ - Admin API implementations │
└─────────────────────────────────────────┘
📚 Documentation
🤝 Contributing
Contributions are welcome! Please see our Contributing Guide for details.
Development Setup
# Clone the repository
# Run in development mode
# Run tests
# Build release version
Adding New Commands
- Add command definition in
rocketmq-admin-core/src/commands/ - Implement the
CommandExecutetrait - Add command to appropriate category enum
- Update documentation and tests
Example:
// In rocketmq-admin-core/src/commands/topic_commands/my_command.rs
use crateCommandExecute;
📄 License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
🔗 Related Projects
- rocketmq-rust - The main RocketMQ Rust implementation
- Apache RocketMQ - Original Java implementation
- rocketmq-admin-core - Core admin library
- rocketmq-admin-tui - Terminal UI for admin operations
🙋 Support
- GitHub Issues: Report bugs or request features
- Discussions: Ask questions and share ideas
- Apache RocketMQ Community: Join the community
📈 Roadmap
- Basic topic management commands
- Consumer management commands
- NameServer operations
- Controller operations
- ACL/Auth management
- Broker management commands
- Message query and resend commands
- Cluster monitoring commands
- Performance testing tools
- Interactive mode (REPL)
- Configuration file support
- Batch operations support
🌟 Acknowledgments
This project is inspired by and aims to be compatible with:
Special thanks to all contributors who have helped make this project better!
Made with ❤️ by the RocketMQ Rust Community