Skip to content

[Feature🚀] Create broker_commands module in rocketmq-admin-core #6279

@mxsm

Description

@mxsm

Feature Description

Create a new broker_commands module in rocketmq-admin-core to implement all broker management commands, achieving feature parity with Java RocketMQ tools.

Problem/Motivation

The rocketmq-admin-core crate currently has commands for auth, consumer, controller, namesrv, and topic management, but lacks broker-specific management commands that are available in the Java version. These broker commands are essential for:

  • Broker monitoring and status checks
  • Configuration management
  • Storage cleanup and maintenance
  • Performance tuning
  • High availability operations
  • Tiered storage management

Proposed Solution

Create a comprehensive broker_commands module that implements all 15 broker management commands from Java RocketMQ:

Module Structure

rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/
└── broker_commands/
    ├── broker_consume_stats.rs
    ├── broker_status.rs
    ├── clean_expired_cq.rs
    ├── clean_unused_topic.rs
    ├── commit_log_set_read_ahead.rs
    ├── delete_expired_commit_log.rs
    ├── get_broker_config.rs
    ├── get_broker_epoch.rs
    ├── get_cold_data_flow_ctr_info.rs
    ├── remove_cold_data_flow_ctr_group_config.rs
    ├── reset_master_flush_offset.rs
    ├── send_msg_status.rs
    ├── switch_timer_engine.rs
    ├── update_broker_config.rs
    └── update_cold_data_flow_ctr_group_config.rs

Related Issues (Subtasks)

Implementation Approach

  1. Create the broker_commands module structure
  2. Define common traits and utilities for broker commands
  3. Implement each command following the pattern established in existing command modules
  4. Add comprehensive unit tests for each command
  5. Add integration tests for end-to-end functionality
  6. Update documentation and examples

Key Considerations

  • Follow Rust idiomatic patterns and the project's coding standards
  • Ensure compatibility with Java RocketMQ broker protocol
  • Implement proper error handling and validation
  • Add detailed logging for operational visibility
  • Design CLI interface consistent with existing commands

Alternatives

  • Could implement commands incrementally without creating module structure first
  • Could merge some similar commands, but better to maintain 1:1 mapping with Java for compatibility

Additional Context

Acceptance Criteria

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions