-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support consumer routers config #1416
support consumer routers config #1416
Conversation
WalkthroughThe recent update enhances router configurations in the Sofa RPC framework with a new constant Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- core/api/src/main/java/com/alipay/sofa/rpc/common/RpcOptions.java (1 hunks)
- core/api/src/main/java/com/alipay/sofa/rpc/config/ConsumerConfig.java (4 hunks)
- core/api/src/test/java/com/alipay/sofa/rpc/client/RouterChainTest.java (1 hunks)
- core/api/src/test/java/com/alipay/sofa/rpc/std/config/ConsumerConfigTest.java (3 hunks)
- core/api/src/test/resources/sofa-rpc/rpc-config.json (1 hunks)
- core/common/src/main/resources/com/alipay/sofa/rpc/common/rpc-config-default.json (1 hunks)
Files skipped from review due to trivial changes (3)
- core/api/src/main/java/com/alipay/sofa/rpc/common/RpcOptions.java
- core/api/src/test/java/com/alipay/sofa/rpc/client/RouterChainTest.java
- core/common/src/main/resources/com/alipay/sofa/rpc/common/rpc-config-default.json
Additional comments not posted (5)
core/api/src/test/resources/sofa-rpc/rpc-config.json (1)
5-5
: Configuration for consumer routers added correctly.core/api/src/test/java/com/alipay/sofa/rpc/std/config/ConsumerConfigTest.java (2)
66-66
: Assertion for router list added correctly.
127-138
: Router-related tests added correctly.core/api/src/main/java/com/alipay/sofa/rpc/config/ConsumerConfig.java (2)
179-180
: Router list initialized correctly from configuration.
689-699
: Method to append routers added correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- core/api/src/main/java/com/alipay/sofa/rpc/client/RouterChain.java (3 hunks)
- core/api/src/main/java/com/alipay/sofa/rpc/filter/FilterChain.java (2 hunks)
- core/api/src/test/resources/sofa-rpc/rpc-config.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- core/api/src/test/resources/sofa-rpc/rpc-config.json
Additional comments not posted (3)
core/api/src/main/java/com/alipay/sofa/rpc/client/RouterChain.java (2)
Line range hint
146-155
: Refactoring to use Java streams enhances readability and maintainability.
Line range hint
146-155
: Verify the impact of removingexcludes = null;
on the lifecycle of theexcludes
set.Verification successful
The removal of the assignment
excludes = null;
does not introduce memory leaks or logical errors. Theexcludes
set is properly managed through its initialization and usage within theRouterChain
class.
excludes
is initialized usingparseExcludeRouter(customRouters)
.- It is used to add elements and check for containment without requiring explicit null assignment.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `excludes` set throughout the RouterChain class to ensure no memory leaks or logical errors are introduced by its removal. # Test: Search for the usage of `excludes`. Expect: Proper management without explicit null assignment. rg --type java 'HashSet<String> excludes' core/api/src/main/java/com/alipay/sofa/rpc/client/RouterChain.javaLength of output: 180
Script:
#!/bin/bash # Description: Verify the usage of `excludes` set throughout the RouterChain class to ensure no memory leaks or logical errors are introduced by its removal. # Test: Search for all usages of `excludes` in the RouterChain class. rg --type java 'excludes' core/api/src/main/java/com/alipay/sofa/rpc/client/RouterChain.javaLength of output: 398
core/api/src/main/java/com/alipay/sofa/rpc/filter/FilterChain.java (1)
Line range hint
196-205
: Refactoring to use Java streams in processing filter aliases improves clarity and reduces error-proneness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
support consumer routers config
Summary by CodeRabbit
New Features
Improvements
Testing
Configuration
rpc-config.json
andrpc-config-default.json
to include new consumer router configurations.