AhriMQ (AMQ)
A high-performance message queue service supporting pub/sub, normal messages, ordered messages, delayed messages and dead letter queues.
Usage
Run AhriMQ Server
# run with default config
# run with config file
Default configuration
# Server configuration
= "127.0.0.1"
= 60001
= "your_access_key"
= "your_access_secret"
= 3
= 60
# Persistence configuration (optional, uses defaults if not specified)
# [persistence]
# wal_max_size = 104857600 # 100MB - WAL file max size
# wal_rotation_count = 10 # Number of WAL files to keep
# buffer_max_size = 1048576 # 1MB - Buffer max size
# buffer_max_entries = 1000 # Max entries in buffer
# flush_interval = 100 # 100ms - Flush interval
# sync_interval = 1000 # 1s - fsync interval
# snapshot_interval = 300 # 5min - Snapshot interval
# snapshot_wal_threshold = 10000 # WAL entries to trigger snapshot
# enable_compression = true # Enable compression
# compression_level = 3 # Compression level (1-21)
Install by downloading binary
Download the latest binary from the releases page and copy it to the desired location.
Install from Crates.io
Install from Source
SDK
Features
- Sub and Pub: Support for publishing and subscribing to messages.
- Normal Messages: Support for normal messages.
- Ordered Messages: Support for ordered messages.
- Delay Messages: Support for delayed messages.
- Dead Letter Queues: Support for dead letter queues.
- High-Performance Persistence: WAL + Snapshot based persistence with async batch writes for minimal performance impact.
Persistence
AhriMQ includes a high-performance persistence engine based on WAL (Write-Ahead Log) and periodic snapshots:
- WAL: Records all message operations with append-only writes for maximum performance
- Snapshots: Periodic full state snapshots for fast recovery
- Async Batch Writes: Background thread with memory buffer (1MB) and 100ms flush interval
- Crash Recovery: Automatic recovery from snapshots + WAL replay
For detailed information, see PERSISTENCE.md.
License
MIT