Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Redis Sharded Pub/Sub to the Multicaster library, enabling more efficient message distribution in Redis cluster environments by distributing channels across multiple shards based on key hashing.
- Introduces a configurable channel factory system allowing selection between default and sharded Redis channels
- Updates Redis group provider to support the new channel factory mechanism
- Adds comprehensive test coverage for sharded pub/sub functionality with Redis cluster setup
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Multicaster.Distributed.Redis/RedisChannelFactory.cs | New factory class providing predefined channel creation methods for default and sharded Redis channels |
| src/Multicaster.Distributed.Redis/RedisGroupOptions.cs | Extracted options class with new ChannelFactory property for customizing channel creation |
| src/Multicaster.Distributed.Redis/RedisGroupProvider.cs | Updated to use configurable channel factory and moved options class to separate file |
| src/Multicaster.Distributed.Redis/RedisGroup.cs | Modified constructor to accept channel factory function for flexible channel creation |
| test/Multicaster.Distributed.Redis.Tests/RedisGroupShardedTest.cs | Comprehensive test suite for sharded pub/sub with Redis cluster setup and connectivity verification |
| test/Multicaster.Distributed.Redis.Tests/RedisGroupTestBase.cs | Base class extracting common test utilities for JSON serialization |
| test/Multicaster.Distributed.Redis.Tests/RedisGroupTest.cs | Refactored to inherit from new base class, removing duplicate helper methods |
| test/Multicaster.Tests/StressTest.cs | New stress test for multicast performance validation |
| Directory.Packages.props | Updated StackExchange.Redis to version 2.8.41 for sharded pub/sub support |
Co-authored-by: Copilot <[email protected]>
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.
This PR enables the use of Sharded Pub/Sub by specifying
RedisChannelFactory.Shardedin theChannelFactoryproperty ofRedisGroupOptions, as shown in the code below.