| Crates.io | allora |
| lib.rs | allora |
| version | 0.0.2 |
| created_at | 2025-11-26 04:28:16.430427+00 |
| updated_at | 2025-11-26 16:58:48.959547+00 |
| description | Allora: Rust-native Enterprise Integration Patterns (EIP) with channels, routing, correlation, and adapters. |
| homepage | https://github.com/fialucci/allora |
| repository | https://github.com/fialucci/allora |
| max_upload_size | |
| id | 1950935 |
| size | 34,611 |
Async-first integration framework for Rust: compose channels, routes, and HTTP adapters to build clear, message-driven systems.
This crate is the user-facing entry point to the Allora ecosystem. It re-exports the core primitives, HTTP adapters, runtime, and macros into a single, convenient API surface.
Allora is a Rust-native take on the classic Enterprise Integration Patterns (EIP) toolbox.
Instead of ad-hoc glue code scattered across your services, you describe message flows:
Think: “Camel / Spring Integration, but as lean, async Rust.”
Use Allora when you want to:
#[service] functions) from wiring (channels, routes, runtime)A simpler web framework (Axum, Actix, etc.) may be enough if you only need a few HTTP handlers and no real routing/correlation logic between them.
0.0.x — experimental / early-stage`tokioMore EIP patterns (splitter, aggregator, content-based router, more outbound adapters, etc.) are planned, but consider the API unstable for now.
Add allora to your Cargo.toml:
[dependencies]
allora = "0.0.1"
A tiny in-memory flow that sends a message through a channel and prints the result.
use allora::{Channel, DirectChannel, Exchange, Message, QueueChannel, Result, Runtime};
#[tokio::main]
async fn main() -> Result<()> {
let rt = Runtime::new().with_config_file("allora.yml").run()?;
// These channel names must be defined in your Allora configuration (allora.yml)
let input: DirectChannel = rt.channel("input_channel");
let output: QueueChannel = rt.channel("output_channel");
input
.send(Exchange::new(Message::from_text("World")))
.await?;
let ex = output
.try_receive()
.await
.expect("processed message");
println!("Message: {}", ex.in_msg.body_text().unwrap_or("(empty)"));
Ok(())
}
This example assumes a small YAML spec (for example allora.yml) that defines the input_channel and output_channel
channels and wires them to whatever services or processors you want. See the project documentation and examples for
sample YAML configurations.
Expose an HTTP endpoint that feeds messages into your flow. This example uses the HTTP inbound adapter and a YAML config.
use allora::{Result, Runtime};
// ensures your services are registered via #[service]
mod http_echo_service;
#[tokio::main]
async fn main() -> Result<()> {
let adapter = Runtime::new()
.with_config_file("allora.yml")
.run()? // load config
.http_inbound_adapters()
.get(0)
.expect("http inbound adapter in config")
.clone();
// Start listening; the adapter returns its bound address and base path
let _server = adapter.clone().spawn_serve();
// Your flow now receives HTTP requests as messages
Ok(())
}
This requires a small YAML spec (allora.yml) describing your channels, services, and HTTP inbound adapter.
A few core ideas, all available from the allora facade:
Message holds the payload (Payload) and headersExchange wraps the inbound message and optional outbound message, plus metadataChannel, PollableChannel, SubscribableChannel, CorrelationSupportDirectChannel (in-memory handoff), QueueChannel (buffered)Processor and ClosureProcessor let you build reusable processing steps#[service] (from allora-macros) turns async functions into discoverable servicesRuntime loads your YAML spec and wires channels, endpoints, adapters, and servicesTogether, these pieces give you explicit, type-safe integration flows rather than ad-hoc chains of function calls.
The facade re-exports HTTP integration types from allora-http:
HttpInboundAdapter
Exchange instancesInOut – wait for downstream processing and return the transformed responseInOnly202 – respond with 202 Accepted and continue processing asynchronouslyHttpOutboundAdapter
out_msg (or in_msg as a fallback)You typically don’t instantiate these types directly in application code; instead you:
allora::adapter::Adapter) and the HTTP extension traitsThe allora crate is a facade over several internal crates in the workspace:
allora (this crate) – user-facing entry point; re-exports the main APIsallora-core – message model, exchanges, channels, processors, services, adaptersallora-http – HTTP inbound/outbound adaptersallora-runtime – runtime engine and YAML DSL for wiring flowsallora-macros – proc macros like #[service] used to define servicesLicensed under Apache-2.0. See the LICENSE file in the repository for details.