Framework Projectors
Angzarr provides several built-in projectors for common operational needs. These are framework-level services that process events without requiring custom business logic.
| Projector | Purpose | Output |
|---|---|---|
| LogService | Debug logging | Console (stdout) |
| EventService | Event storage | Database (SQL) |
| OutboundService | Real-time streaming + external publishing | gRPC streams, HTTP/Kafka |
LogService
Pretty-prints events to stdout with optional JSON decoding. Useful for development debugging and monitoring event flow.
Features
- ANSI color-coded output by event type
- JSON decoding via prost-reflect (if descriptors provided)
- Hex dump fallback for unknown types
Configuration
| Variable | Description |
|---|---|
DESCRIPTOR_PATH | Path to FileDescriptorSet for JSON decoding |
Output Example
illustrative - LogService console output
────────────────────────────────────────────────────────
orders:abc123de:0000000005
OrderCreated
────────────────────────────────────────────────────────
{
"order_id": "ORD-12345",
"customer_id": "CUST-789",
"total": 9999
}
Color Coding
| Event Pattern | Color |
|---|---|
*Created | Green |
*Completed | Cyan |
*Cancelled, *Failed | Red |
*Added, *Applied | Yellow |
| Other | Blue |
Usage (Rust)
illustrative - LogService usage
use angzarr::handlers::projectors::{LogService, LogServiceHandle};
let service = LogService::new();
// Or with descriptors
std::env::set_var("DESCRIPTOR_PATH", "/path/to/descriptors.bin");
let service = LogService::new();
// Use as gRPC service
let handle = LogServiceHandle(Arc::new(service));
EventService
Stores all events as JSON in a SQL database for querying, debugging, and audit trails.