Design and implement new conditional rules V3.1 #2686
Merged
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.
Doc for New Routing Configuration
Configuration Format
This doc show how to set up condition-router configurations for your services/application.
The configurations are defined in a YAML format and must adhere to specific rules and parameters to ensure proper functioning.
Examples
Configuration Structure
Top-Level Structure
v3.1
orV3.1
to use this configuration format.service
orapplication
.org.apache.dubbo.samples.CommentService
.true
, it returns an error; iffalse
, it ignores this rule.Conditions
Each condition block contains the following parameters:
region=$region & version=v1
.false
. If set totrue
andfrom
matches successfully, it ignores theto
,force
, andratio
values within the condition, and theforce
value at the top level, returning empty.INT_MAX
and a minimum of 0.true
, it returns empty; iffalse
, it jumps to the next condition.20
meansresult/all-peers >= 20%
.Matching and Filtering Conditions
Supported Parameters
interface
,method
,group
,version
.attachments[key] = value
.arguments[0] = tom
.protocol
,host
,port
.application
,organization
.Condition Operators
method = getComment
.method != getComment
.Value Support
host != 10.20.153.10,10.20.153.11
.host != 10.20.*
.region = $region
.userId = 1~100
oruserId = 101~
.