Redis broker¶
ruststream-fred is the Redis broker for the RustStream
framework. It is built on Redis Streams: every subscription reads through a consumer group, so
deliveries are durable and acknowledged. It also ships an in-memory test broker under its testing
feature.
ruststream = { version = "0.4", features = ["macros"] }
ruststream-fred = "0.4"
serde = { version = "1", features = ["derive"] }
RedisBroker::standalone is synchronous and does no I/O, so a Redis service is assembled with the
same #[ruststream::app] macro as any other broker. The runtime connects the broker once at startup,
before opening subscriptions.
Topologies¶
One crate, three named constructors. Each is synchronous and connects lazily:
# standalone
# RedisBroker::standalone("redis://localhost:6379")
# cluster (one reachable seed node is enough; the rest is discovered)
# RedisBroker::cluster(["127.0.0.1:7000", "127.0.0.1:7001"])
# sentinel (the monitored primary's name plus the sentinels)
# RedisBroker::sentinel("mymaster", ["127.0.0.1:26379"])
Transport guides¶
- Redis Streams — consumer groups, fresh tail vs reclaim, delayed retry.
- Redis Lists — competing-consumers work queue, reliable mode, orphan recovery.
- Pub/Sub — classic and sharded broadcast.
- Dead-letter and poison cap — bound infinite redelivery.
- Authentication and TLS — credentials and TLS on every topology.
- Transactions — batch publishing on standalone and sentinel.
- Testing — in-process handler-stub broker.