Skip to main content

Crate ruststream_fred

Crate ruststream_fred 

Source
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§

RedisBroker
A Redis broker handle backed by a fred connection Pool.
RedisList
Describes one list subscription against crate::RedisBroker.
RedisListMessage
A list-queue delivery. In simple mode ack / nack are unsupported; in reliable mode ack removes the entry from the processing list and nack either returns it or drops it.
RedisListPublisher
Publishes onto a list with LPUSH, so right-popping consumers see FIFO order.
RedisListSubscriber
A list-backed work-queue subscription.
RedisMessage
A Redis Streams delivery, read from a consumer group via XREADGROUP or XAUTOCLAIM.
RedisPubSub
Describes one Pub/Sub subscription against crate::RedisBroker.
RedisPubSubMessage
A Pub/Sub delivery. ack / nack are unsupported (Pub/Sub has no acknowledgement).
RedisPubSubPublisher
Publishes Pub/Sub messages with PUBLISH (classic) or SPUBLISH (sharded).
RedisPubSubSubscriber
A Pub/Sub subscription backed by a dedicated fred client, so its message stream and channel state are isolated from other subscribers and from the publishing pool.
RedisPublisher
Redis publisher built on a shared fred connection pool. Cheap to clone.
RedisStream
Describes one Redis Streams subscription against crate::RedisBroker.
RedisSubscriber
A Redis Streams subscription bound to a consumer group.
TlsConfig
TLS configuration for a client.

Enums§

DelayedRetry
How a subscription should handle retry_after / nack_after delays.
PubSubMode
Pub/Sub delivery mode. Defaults to Classic.
RedisError
Errors surfaced by the Redis broker implementation.
StreamStart
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§

CredentialProvider
A trait that can be used to override the credentials used in each AUTH or HELLO command.