hermes-rs
Hermes is a lightweight, async event broker for Rust built on gRPC. It supports fire-and-forget fanout, queue groups for load-balanced consumption, and durable delivery with ack/nack and automatic redelivery.
Features
- Typed events — define events as Rust structs with
#[derive(Event)], serialized automatically - Fanout — every subscriber receives every message
- Queue groups — competing consumers, each message delivered to exactly one subscriber per group
- Event groups — subscribe to multiple event types as a single merged stream
- Durable delivery — at-least-once with persistence, ack/nack, redelivery, and dead-lettering
- Batch publishing — high-throughput buffered publisher
- Wildcard subscriptions —
*(single segment) and>(rest) pattern matching - gRPC transport — built on tonic, HTTP/2 multiplexed
Quick start
1. Start the broker
use TcpListener;
async
Or run directly:
2. Publish and subscribe
use StreamExt;
use HermesClient;
use Event;
use ;
async
3. Queue groups (load balancing)
use StreamExt;
use HermesClient;
use Event;
use ;
async
4. Durable delivery (at-least-once)
use HermesClient;
use Event;
use ;
async
Crates
| Crate | Description |
|---|---|
hermes-broker-client |
Typed async client — publish, subscribe, durable, batch |
hermes-broker-server |
Broker server with fanout, queue groups, durable mode |
hermes-broker-core |
Event trait, subject types, encoding helpers |
hermes-broker-proto |
Protobuf/gRPC generated types and services |
hermes-broker-store |
Durable message storage backend (redb) |
hermes-broker-macros |
#[derive(Event)] and event_group! macros |
Server configuration
Configure via environment variables or ServerConfig struct:
HERMES_STORE_PATH=./hermes.redb \ # enables durable mode
HERMES_ACK_TIMEOUT=30 \
HERMES_MAX_DELIVERY_ATTEMPTS=5 \
Without HERMES_STORE_PATH, the server runs in fire-and-forget mode only.
See the server README for all configuration options.
Development
After cloning, install the git hooks:
This sets up a pre-push hook that runs cargo fmt --check and blocks the push if code is unformatted.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.