Expand description
§RocketMQ Controller Module
High-availability controller implementation for RocketMQ, providing:
- Raft-based consensus for leader election and metadata replication
- Broker registration and heartbeat management
- Topic metadata management and synchronization
- Configuration management across the cluster
§Architecture
┌─────────────────────────────────────────┐
│ Controller Manager (Entry) │
└──────────────┬──────────────────────────┘
│
┌───────┴────────┐
│ │
┌──────▼──────┐ ┌─────▼──────┐
│ Raft Module │ │ Processor │
│ (raft-rs) │ │ Layer │
└──────┬──────┘ └─────┬──────┘
│ │
└────────┬───────┘
│
┌────────▼─────────┐
│ Metadata Store │
│ (DashMap/Raft) │
└──────────────────┘§Usage
ⓘ
use rocketmq_controller::ControllerConfig;
use rocketmq_controller::ControllerManager;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let config = ControllerConfig::default();
let mut controller = ControllerManager::new(config)?;
controller.start().await?;
// Controller is now running...
controller.shutdown().await?;
Ok(())
}Re-exports§
pub use config::ControllerConfig;pub use error::ControllerError;pub use error::Result;pub use manager::ControllerManager;
Modules§
- config
- error
- manager
- metadata
- processor
- raft
- rpc
- RPC module for Controller
- storage
- Storage backend abstraction
Constants§
- DEFAULT_
CONTROLLER_ PORT - Default controller listen port
- VERSION
- Controller module version