feat: add support for ioredis Cluster with Sharded Pub/Sub#570
Closed
seta-chuang-0909 wants to merge 1 commit intosocketio:mainfrom
Closed
feat: add support for ioredis Cluster with Sharded Pub/Sub#570seta-chuang-0909 wants to merge 1 commit intosocketio:mainfrom
seta-chuang-0909 wants to merge 1 commit intosocketio:mainfrom
Conversation
- 在 util.ts 中添加 isIoRedisCluster 和 hasShardedSubscribers 輔助函數 - 在 sharded-adapter.ts 中添加 ioredis Cluster 配置驗證 - 啟用 [sharded] ioredis cluster 測試(需要 shardedSubscribers: true) - 更新 package.json 中 ioredis 版本要求到 ^5.9.0 - 更新 README.md 添加 ioredis Cluster 與 sharded pub/sub 的使用說明 - 添加 ioredis Cluster 的 natMap 配置以解決 Docker 環境問題 參考: redis/ioredis#1956
Retr0327
approved these changes
Jan 12, 2026
darrachequesne
pushed a commit
that referenced
this pull request
Jan 20, 2026
Support for sharded pub/sub was added in `ioredis@5.9.0`. Related: - redis/ioredis#1759 - redis/ioredis#1956
Member
|
Merged as c2d668b. Thanks a lot 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for using the sharded adapter with
ioredisCluster, which was previously not possible due to ioredis#1759.Starting with
ioredis@5.9.0, the sharded Pub/Sub functionality has been fixed via ioredis#1956, enabling proper routing of SSUBSCRIBE/SPUBLISH commands in cluster mode.Changes
New Features
shardedSubscribersoption is enabledshardedSubscribersoption when using ioredis ClusterDocumentation
Tests
[sharded] ioredis clustertestshardedSubscribers: trueoption to the test configurationnatMapconfiguration for Docker environment compatibilityDependencies
ioredisdev dependency from^5.3.2to^5.9.0Usage