Skip to content

Add Redis Cluster broker support#2854

Open
powersemmi wants to merge 2 commits into
mainfrom
feature/redis-cluster-broker
Open

Add Redis Cluster broker support#2854
powersemmi wants to merge 2 commits into
mainfrom
feature/redis-cluster-broker

Conversation

@powersemmi
Copy link
Copy Markdown
Collaborator

@powersemmi powersemmi commented May 4, 2026

Description

This PR introduces RedisClusterBroker — a new broker for Redis Cluster, inheriting from RedisBroker with the same constructor API for drop-in compatibility.

Key features:

  • Redis Cluster connection via startup_nodes with auto-discovery
  • Standard Pub/Sub (PUBLISH/SUBSCRIBE, sharded=False) for single-node delivery
  • List and Stream operations with automatic hash-slot routing via RedisCluster client
  • XAUTOCLAIM support for cyclic re-consumption of pending stream messages (min_idle_time)
  • Full RedisBroker API compatibility — migrate by changing the class name
  • Pipeline warning — raises RuntimeWarning if pipeline= is passed (not supported in cluster)

Documentation:

  • New docs/docs/en/redis/cluster.md — feature comparison, migration guide, limitations
  • Cross-references from Pub/Sub, Streams, Pipeline, and Claiming pages

Fixes #1170

Type of change

  • New feature (a non-breaking change that adds functionality)
  • This change requires a documentation update

Checklist

  • My code adheres to the style guidelines of this project (just lint shows no errors)
  • I have conducted a self-review of my own code
  • I have made the necessary changes to the documentation
  • My changes do not generate any new warnings
  • I have added tests to validate the effectiveness of my fix or the functionality of my new feature
  • Both new and existing unit tests pass successfully on my local environment by running just test-coverage
  • I have ensured that static analysis tests are passing by running just static-analysis
  • I have included code examples to illustrate the modifications

@powersemmi powersemmi requested a review from Lancetnik as a code owner May 4, 2026 15:41
@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file Redis Issues related to `faststream.redis` module and Redis features labels May 4, 2026
@powersemmi powersemmi requested a review from theseriff May 4, 2026 15:41
@powersemmi powersemmi self-assigned this May 4, 2026
@powersemmi powersemmi force-pushed the feature/redis-cluster-broker branch 2 times, most recently from 3528945 to fc42629 Compare May 4, 2026 16:36
@github-actions github-actions Bot added the github_actions Pull requests that update GitHub Actions code label May 4, 2026
@powersemmi powersemmi force-pushed the feature/redis-cluster-broker branch 2 times, most recently from 1b035b0 to 2a2b32a Compare May 4, 2026 16:44
@powersemmi powersemmi force-pushed the feature/redis-cluster-broker branch 13 times, most recently from 298004c to cf6ae92 Compare May 11, 2026 09:51
@powersemmi powersemmi force-pushed the feature/redis-cluster-broker branch 8 times, most recently from 1b32ee4 to ef6f1ca Compare May 13, 2026 02:33
Extract `ClusterConnectionState` logic into the base `ConnectionState`
class
as a generic, and move shared broker type annotations into a new
`faststream/redis/schemas/types.py` module to reduce import clutter and
duplication.
@powersemmi powersemmi force-pushed the feature/redis-cluster-broker branch from ef6f1ca to 22fdfcc Compare May 14, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation github_actions Pull requests that update GitHub Actions code Redis Issues related to `faststream.redis` module and Redis features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Adds support for the Redis cluster

1 participant