Installation
Getting started with Kincir is straightforward. This guide will walk you through the steps to add Kincir to your Rust project.
Requirements
Kincir requires:
- Rust 1.56 or later
- Cargo (Rust’s package manager)
- Depending on which backends you enable, you may need additional system dependencies
Adding Kincir to Your Project
Add Kincir to your Cargo.toml
file:
[dependencies]
kincir = "0.1.0"
Enabling Specific Message Broker Backends
Kincir uses feature flags to keep dependencies minimal. Enable only the backends you need:
[dependencies]
kincir = { version = "0.1.0", features = ["kafka", "rabbitmq"] }
Available features include:
kafka
: Enables Apache Kafka supportrabbitmq
: Enables RabbitMQ supportredis
: Enables Redis Streams supportnats
: Enables NATS supportprotobuf
: Adds Protocol Buffers serialization supportjson
: Adds JSON serialization support (enabled by default)tracing
: Enables tracing integrationmetrics
: Enables metrics collection
Verifying Installation
To verify that Kincir is correctly installed, create a simple Rust program:
use kincir::prelude::*;
fn main() {
println!("Kincir version: {}", kincir::VERSION);
}
Compile and run the program:
cargo run
If everything is set up correctly, you should see the Kincir version printed to the console.
System Dependencies
Depending on which message broker backends you enable, you might need to install additional system libraries.
Kafka Backend
If you’re using the Kafka backend (kafka
feature), you’ll need:
- librdkafka 1.8.0 or later
- OpenSSL development libraries (for secure connections)
Ubuntu/Debian:
sudo apt-get install librdkafka-dev libssl-dev
macOS (using Homebrew):
brew install librdkafka openssl
RabbitMQ Backend
If you’re using the RabbitMQ backend (rabbitmq
feature), you’ll need:
- AMQP client libraries
Ubuntu/Debian:
sudo apt-get install librabbitmq-dev
macOS (using Homebrew):
brew install rabbitmq-c
Next Steps
Once you have Kincir installed, you can proceed to the Quick Start guide to learn how to create publishers and subscribers.