ahrimq

Crates.ioahrimq
lib.rsahrimq
version0.0.7
created_at2025-04-02 09:34:15.095188+00
updated_at2026-01-10 06:40:47.105617+00
descriptionA high-performance message queue service supporting pub/sub, normal messages, ordered messages, delayed messages and dead letter queues.
homepage
repositoryhttps://github.com/ahriroot/ahrimq
max_upload_size
id1616287
size285,235
ahriknow (ahriroot)

documentation

https://github.com/ahriroot/ahrimq

README

AhriMQ (AMQ)

Build Status GitHub Release License

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
amqs

# run with config file
amqs config.toml

Default configuration

# Server configuration
host = "127.0.0.1"
port = 60001
access_key = "your_access_key"
access_secret = "your_access_secret"
retry_times = 3
retry_interval = 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

cargo install ahrimq

Install from Source

git clone https://github.com/ahriroot/ahrimq.git
cd ahrimq
cargo build --release

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

Commit count: 24

cargo fmt