Major Features
High-Performance Write Buffering
- Implemented batch write mechanism with configurable
batch_size,flush_interval, andbuffer_size - Async channel-based buffering reduces database roundtrips
- Achieves ~39k msg/sec on SQLite (M1 MacBook Pro)
PostgreSQL Support
- Full PostgreSQL driver support with connection pooling
- Configurable
max_open_conns,max_idle_conns,conn_max_lifetime - SQL query compatibility with
sqlx.Rebind()for placeholder conversion
Subscriber Caching
- In-memory cache for subscriber lookups with configurable TTL
- Reduces database queries during message publishing
- Automatic cache invalidation on subscriber changes
Enhanced Listener Configuration
- Configurable
poll_intervalfor message polling - Configurable
dequeue_batch_sizefor batch consumption - Exponential backoff on empty queue (up to
max_backoff)
Performance Improvements
SQLite Optimizations
- WAL mode with periodic checkpointing
- Configurable
cache_sizeandmmap_size busy_timeoutconfiguration for concurrent access
Database Driver Improvements
- Proper
PRAGMA wal_checkpointhandling (SQLite only) - Connection string fixes for PostgreSQL empty password/timezone
- Batch INSERT with parameter limit handling (PostgreSQL 65535 limit)
New Examples
example/basic/- Simple usage with numbered stepsexample/sqlite/- SQLite with CLI flags and graceful shutdownexample/pgsql/- PostgreSQL with connection configurationexample/http/- HTTP client example
Configuration Updates
New config.yaml options:
sqlite:
cache_size: -4000 # 4MB page cache
mmap_size: 0 # Memory-mapped I/O size
write_buffer:
batch_size: 100 # Messages per batch
flush_interval: 100ms # Max time before flush
buffer_size: 10000 # Channel buffer size
pgsql:
max_open_conns: 25
max_idle_conns: 10
conn_max_lifetime: 5m
conn_max_idle_time: 1mTest Coverage
- Added
TestPartialAck- verifies partial acknowledgment behavior - Added
TestVisibilityTimeout- verifies message status changes - Added
TestLongPolling- verifies subscriber blocking read - Comprehensive benchmark suite (
benchmark_test.go)
Breaking Changes
- Removed legacy partition fields from
BlockQueueOption WriteBufferConfigreplaces old partition configuration
Documentation
- Completely rewritten README with HTTP and Library usage modes
- API reference table with all endpoints
- Driver configuration examples for SQLite, PostgreSQL, and Turso
Full Changelog: v0.0.5-beta...v0.1.1