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

vs. Other Messaging Libraries

Comparison


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)

πŸ”„ v0.3 – Middleware & Backend Expansion

πŸ“Š v0.4 – Distributed Tracing & Monitoring

πŸ›  v0.5 – Hardening & API Freeze

πŸš€ v1.0 – Production-Ready Release


Getting Started

Ready to dive in? Check out our comprehensive documentation:


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