Kincir
Building event-driven applications the easy way in Rust
Kincir is a unified message streaming library for Rust that provides a consistent interface for working with multiple message broker backends.
Key Features
π§ Unified Interface
A simple, consistent API for publishing and subscribing to messages across different messaging systems.
π Multiple Backends
Support for Kafka, RabbitMQ, MQTT, and in-memory brokers with the same interface.
π Message Acknowledgments
Comprehensive acknowledgment support across all backends for reliable message processing.
π― Event-Driven Architecture
Build robust event-driven applications with reliable message passing and processing.
π High Performance
Designed for performance with Rustβs safety guarantees and zero-cost abstractions.
Quick Start
Add Kincir to your Cargo.toml
:
[dependencies]
kincir = "0.2.0"
Basic Example
use kincir::memory::{InMemoryBroker, InMemoryPublisher, InMemorySubscriber};
use kincir::{Publisher, Subscriber, Message};
use std::sync::Arc;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
// Create an in-memory broker
let broker = Arc::new(InMemoryBroker::with_default_config());
let publisher = InMemoryPublisher::new(broker.clone());
let mut subscriber = InMemorySubscriber::new(broker.clone());
// Subscribe to a topic
subscriber.subscribe("events").await?;
// Publish a message
let message = Message::new(b"Hello, Kincir!".to_vec());
publisher.publish("events", vec![message]).await?;
// Receive the message
let received = subscriber.receive().await?;
println!("Received: {:?}", String::from_utf8_lossy(&received.payload));
Ok(())
}
Supported Backends
Backend | Publisher | Subscriber | Acknowledgments | Status |
---|---|---|---|---|
In-Memory | β | β | β | Stable |
RabbitMQ | β | β | β | Stable |
Kafka | β | β | β | Stable |
MQTT | β | β | β | Stable |
Architecture
Kincir provides a unified interface that abstracts away the complexity of different message brokers:
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β Application β β Kincir β β Message Broker β
β β β Unified β β β
β Publisher/ βββββΊβ Interface βββββΊβ RabbitMQ/Kafka β
β Subscriber β β β β MQTT/Memory β
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
Why Kincir?
vs. Direct Broker APIs
- Unified Interface: Switch between brokers without changing your application code
- Simplified Development: One API to learn instead of multiple broker-specific APIs
- Future-Proof: Add new brokers without changing existing code
vs. Other Messaging Libraries
- Rust-First: Built specifically for Rust with zero-cost abstractions
- Comprehensive: Supports acknowledgments, routing, and advanced features
- Performance: No overhead compared to direct broker usage
- Type Safety: Leverages Rustβs type system for safer message handling
Comparison
- vs. Watermill (Go): Similar feature set but with Rustβs performance and safety
- vs. Direct Broker APIs: Simplified interface with no performance penalty
- vs. Other Rust Libraries: More comprehensive feature set
Roadmap to v1.0 π
Kincir is evolving towards feature parity with Watermill (Golang) while leveraging Rustβs performance and safety.
β v0.2 β Core Enhancements (COMPLETED)
- β In-memory message broker for local testing
- β Advanced features: message ordering, TTL, health monitoring
- β Comprehensive statistics and performance metrics
- β Thread-safe concurrent operations with deadlock resolution
- β Unit & integration tests for stability (65/65 tests passing)
π v0.3 β Middleware & Backend Expansion
- Middleware framework: logging, retry, recovery, correlation
- Additional broker support (e.g., NATS, AWS SQS)
- Optimized async pipeline for lower latency
- Integration tests for middleware + new backends
π v0.4 β Distributed Tracing & Monitoring
- OpenTelemetry-based tracing for message flows
- Prometheus metrics for message processing
- Poison queue (dead-letter handling)
- Throttling & backpressure support
- Stress testing and performance benchmarking
π v0.5 β Hardening & API Freeze
- API finalization for stability
- Cross-platform testing (Linux, macOS, Windows)
- Memory optimization and async efficiency improvements
- Comprehensive documentation and migration guide
π v1.0 β Production-Ready Release
- High-performance, production-ready messaging library
- Fully stable API with semantic versioning
- Complete Watermill feature parity (middleware, observability, routing)
- Extensive test coverage and robust CI/CD pipeline
- Community engagement and ecosystem expansion
Getting Started
Ready to dive in? Check out our comprehensive documentation:
- Getting Started Guide - Complete setup and basic usage
- Examples - Comprehensive examples for all backends
- API Documentation - Full API reference
Quick Links
- Documentation: Getting Started
- Examples: Comprehensive Examples
- GitHub: Source Code
- Crates.io: Package
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Ready to start building?
Check out the documentation to learn how to integrate Kincir into your Rust applications.
Get Started | API Reference | Examples |
Kincir is licensed under the Apache License, Version 2.0