Expand description
Redis / Valkey broker implementation for RustStream, backed by fred.
This crate implements the RustStream broker contract over Redis Streams: durable consumer
groups with acknowledgement, redelivery, and crash recovery. Subjects are stream keys; a
subscription reads through a consumer group, either off the fresh tail
(RedisStream::new) or reclaiming another consumer’s stale pending entries
(RedisStream::reclaim).
Settlement follows the republish-retry model: ack is XACK, nack(requeue = true) re-appends
a copy to the same stream then acks the original, and nack(requeue = false) acks to drop.
Modules§
- testing
- In-process Redis test driver used by handler integration tests.
Structs§
- Redis
Broker - A Redis broker handle backed by a
fredconnectionPool. - Redis
List - Describes one list subscription against
crate::RedisBroker. - Redis
List Message - A list-queue delivery. In simple mode
ack/nackare unsupported; in reliable modeackremoves the entry from the processing list andnackeither returns it or drops it. - Redis
List Publisher - Publishes onto a list with
LPUSH, so right-popping consumers see FIFO order. - Redis
List Subscriber - A list-backed work-queue subscription.
- Redis
Message - A Redis Streams delivery, read from a consumer group via
XREADGROUPorXAUTOCLAIM. - Redis
PubSub - Describes one Pub/Sub subscription against
crate::RedisBroker. - Redis
PubSub Message - A Pub/Sub delivery.
ack/nackare unsupported (Pub/Sub has no acknowledgement). - Redis
PubSub Publisher - Publishes Pub/Sub messages with
PUBLISH(classic) orSPUBLISH(sharded). - Redis
PubSub Subscriber - A Pub/Sub subscription backed by a dedicated
fredclient, so its message stream and channel state are isolated from other subscribers and from the publishing pool. - Redis
Publisher - Redis publisher built on a shared
fredconnection pool. Cheap to clone. - Redis
Stream - Describes one Redis Streams subscription against
crate::RedisBroker. - Redis
Subscriber - A Redis Streams subscription bound to a consumer group.
- TlsConfig
- TLS configuration for a client.
Enums§
- Delayed
Retry - How a subscription should handle
retry_after/nack_afterdelays. - PubSub
Mode - Pub/Sub delivery mode. Defaults to
Classic. - Redis
Error - Errors surfaced by the Redis broker implementation.
- Stream
Start - Where a freshly created consumer group starts reading from. Only consulted when the group does not yet exist; an existing group keeps its own cursor.
- TlsConnector
- An enum for interacting with various TLS libraries and interfaces.
Constants§
- DEAD_
LETTER_ REASON_ HEADER - Header naming why a message was dead-lettered: [
REASON_DROPPED] or [REASON_MAX_DELIVERIES]. - DELIVERY_
COUNT_ HEADER - Header exposing the native Redis Streams delivery count on a reclaimed delivery, so a handler can branch or dead-letter manually.
- IDLE_
MS_ HEADER - Header exposing how long (milliseconds) a reclaimed delivery had been pending.
- PARTITION_
KEY_ HEADER - The well-known header key for per-message routing / partitioning.
Traits§
- Credential
Provider - A trait that can be used to override the credentials used in each
AUTHorHELLOcommand.