Expand description
Allora – Integration Patterns & Message Flow Building Blocks
High-level, lightweight primitives for composing message-driven flows in Rust.
Provides channels, messages, exchanges, simple filters/patterns, plus a facade
(Runtime) for bootstrapping a runtime from a YAML configuration file.
§Key Concepts
- Message – immutable payload + headers
- Exchange – mutable processing context (in/out message, headers, correlation)
- Channel – in-memory endpoint for sending/receiving
Exchangeinstances - Filter (pattern) – predicate over an
Exchange - Runtime – collection of declared channels & filters built from a spec
§Features
Async-only architecture; HTTP adapters and serialization always enabled (no feature flags).
§Crate Use
- Programmatic: build channels/filters directly via builders
- Declarative: provide
allora.ymland useRuntime::new().run()
§Minimal Programmatic Example
use allora_core::{patterns::filter::Filter, Exchange, Message};
let mut exchange = Exchange::new(Message::from_text("ping"));
let f = Filter::new(|e: &Exchange| e.in_msg.body_text() == Some("ping"));
assert!(f.accepts(&exchange));§Minimal YAML Channel Spec
version: 1
channels:
- kind: direct
id: inbound
- kind: direct
id: outboundBuild from file with:
let rt = Runtime::new().with_config_file("./allora.yml").run()?;
assert!(rt.channel_by_id("inbound").is_some());§Building Components Directly
use allora_runtime::{build_channel_from_str, DslFormat, Channel};
let raw = "version: 1\nchannel:\n kind: direct\n id: demo";
let ch = build_channel_from_str(raw, DslFormat::Yaml).unwrap();
assert_eq!(ch.id(), "demo");§Errors
All builder and facade operations surface failures via Error.
Use Result<T, Error> and propagate with ?.
§License
MIT OR Apache-2.0.
§Stability & Versioning
- Parsers enforce
version. - New versions add new parser modules.
Re-exports§
pub use dsl::runtime::AlloraRuntime;pub use dsl::build;pub use dsl::build_channel;pub use dsl::build_channel_from_str;pub use dsl::build_filter;pub use dsl::build_service;pub use dsl::DslFormat;pub use runtime::Runtime;pub use inventory;
Modules§
- adapter
- channel
- Channel module – lightweight in-process message pipes.
- dsl
- DSL Facade: multi-format (YAML today; JSON/XML forthcoming) configuration entry points.
- endpoint
- Endpoint abstraction: a lightweight FIFO inbox for Exchanges.
- error
- Error types and result alias for Allora.
- logging
- Logging utilities (internal use).
- message
- Messaging core types:
Payload,Message, andExchange. - patterns
- Integration Patterns module: collection of Enterprise Integration Patterns (EIP) primitives.
- processor
- route
- runtime
- High-level application facade.
- service
- ServiceActivator trait: metadata & channel binding intent for a service (activator). Service trait: async-only business logic component.
- service_
activator_ processor - spec
- Spec module: programmatic component specification data models and format parsers.
Structs§
- Adapter
- Staged builder root: pattern-first entry (
Adapter::inbound().http()...). - Closure
Processor - Direct
Channel - Direct, synchronous handoff channel.
- Endpoint
Builder - Staged builder root for endpoints.
- Exchange
- An exchange wraps an inbound and outbound message, plus routing properties.
- Filter
- Http
Inbound Adapter - Http
Inbound Builder - Http
Outbound Adapter - Http
Outbound Adapter Builder - InMemory
Endpoint - An in-memory FIFO endpoint for quick testing.
- Message
- A message containing a payload and headers (metadata).
- Outbound
Dispatch Result - Metadata returned from outbound dispatch. Leave fields optional / expandable for future.
- Queue
Channel - Route
- A
Routerepresents an ordered pipeline ofProcessorimplementations applied to anExchange. Each processor can mutate theExchange(e.g. enrich headers, transform the payload, setout_msg, assign correlation identifiers, etc.). - Service
Descriptor
Enums§
- Endpoint
Source - Source metadata describing origin of messages entering an endpoint.
- Error
- Mep
- Message Exchange Pattern for HTTP inbound.
- Payload
- Represents the payload of a message, supporting text, bytes, JSON, or empty.
Traits§
- Channel
- Core channel trait providing send capabilities and metadata.
- Correlation
Support - Correlation lookup extension (QueueChannel only).
- Endpoint
- A trait representing a message endpoint for sending and receiving
Exchangeobjects. - Inbound
Adapter - Inbound adapter: receives external data/events and produces
Exchanges routed inside Allora. - Inbound
Http Ext - Extension trait adding
.http()to the coreInboundStage. - Outbound
Adapter - Outbound adapter: sends data derived from an
Exchangeto an external system. - Outbound
Http Ext - Extension trait adding
.http()to the coreOutboundStage. - Pollable
Channel - Dequeue extension (QueueChannel).
- Processor
- A Processor transforms an Exchange (async-only model).
- Service
- Service
Activator - Internal metadata describing how a service is wired. Users do NOT implement this directly; it is derived from specs.
- Subscribable
Channel - Register-and-fanout extension trait (DirectChannel).
Functions§
- all_
service_ descriptors - ensure_
correlation - Ensure a
correlation_idheader exists on the inbound message of the providedExchange. Safe to call multiple times (id will be stable after first generation).
Type Aliases§
- Boxed
Processor - Boxed dynamic processor type.
Useful for heterogeneous collections (used internally by
Route). - Channel
Ref - Type alias for a trait object reference to any Channel implementation.
- Result