mqutils
GitLab ↗

Docs / Backends / Redis deduplication adapter

Redis deduplication adapter

Optional durable Redis claim store for RabbitMQ Stream consumer deduplication

This optional module implements the Stream backend’s atomic deduplication-store contract. It does not register a broker URL scheme. See the application deduplication guide for leases, retention, manual acknowledgment, and transactional inbox boundaries. Redis must retain active claims and completed entries: the adapter requires maxmemory-policy=noeviction and checks it using CONFIG GET.

go
import "go.digitalxero.dev/mq-rmqstream-dedupredis/v2"

Package dedupredis provides a durable Redis claim store for RabbitMQ Stream consumer deduplication. Redis must use maxmemory-policy=noeviction. Restart durability depends on Redis persistence and replication: configure AOF and appropriate fsync/replication guarantees for the required failure model.

Index

typeBuilder

Builder configures the store. Build verifies noeviction before allowing any claims. CONFIG GET permission is required, including on managed Redis. Cluster validation checks every known primary and replica. Keep noeviction in force on existing and newly added nodes for the store’s lifetime. Use a dedicated Redis database or prefix with no external mutation/expiry of these keys.

Known go-redis clients must enable ContextTimeoutEnabled and finite socket, dial and pool timeouts. Redis Ring is rejected because removing a failed shard rehashes keys onto independent data and can bypass active/completed claims. Custom UniversalClient wrappers must themselves honor context deadlines, use bounded I/O, and verify noeviction on every node they may route to; their hidden options/topology cannot be inspected. Custom hooks/dialers also must honor ctx.

go
type Builder interface {
    WithURL(string) Builder
    WithClient(redis.UniversalClient) Builder
    WithPrefix(string) Builder
    Build(context.Context) (Store, error)
}

funcNew

go
func New() Builder

typeStore

Store is a fenced Redis claim store. Close releases only an internally created client; a client supplied by WithClient remains owned by the caller.

go
type Store interface {
    rmqstream.DeduplicationStore
    io.Closer
}

Generated by gomarkdoc

move open/ opens search anywhere