The Redis broker for the RustStream messaging framework: Redis Streams consumer groups, standalone / cluster / sentinel topologies, and an in-process test broker.
ruststream-fred implements the RustStream broker contract over fred, using Redis Streams as the durable transport. Handlers, routers, codecs, and middleware come from the framework; this crate supplies the transport - and nothing broker-specific leaks back into the framework.
- Redis Streams with consumer groups. Subscribe through a group off the fresh tail
(
RedisStream::new), or reclaim a crashed consumer's pending entries (RedisStream::reclaim). Payload and headers round-trip as stream entry fields. - Standalone, cluster, and sentinel. One crate, named constructors pick the topology:
RedisBroker::standalone,::cluster,::sentinel. - Authentication and TLS on every topology.
.credentials/.passwordset the auth fields beyond what a standalone URL can express; optional features add TLS (tls-rustls,tls-rustls-ring,tls-native-tls), sentinel-specific auth (sentinel-auth), and a dynamiccredential-providerfor IAM-style rotation. - Lazy startup contract.
RedisBroker::standalone(url)is synchronous and does no I/O; the runtime connects once at startup, so the broker composes with#[ruststream::app]. An existingfredpool plugs in viaRedisBroker::from_pool. - Acknowledgement via the republish-retry model.
ackisXACK;nack(requeue = true)re-appends a copy to the stream then acks the original (at-least-once);nack(requeue = false)acks to drop. - In-process test broker. The
testingfeature shipsRedisTestBroker/RedisTestClient, a handler-stub transport that passes the framework's conformance suite without a server.
[dependencies]
ruststream = { version = "0.4", features = ["macros", "json"] }
ruststream-fred = "0.4"
serde = { version = "1", features = ["derive"] }Apache-2.0.