Skip to content
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

Ftr: Feature/application and service level router #662

Merged

Conversation

williamfeng323
Copy link
Contributor

@williamfeng323 williamfeng323 commented Jul 18, 2020

What this PR does:

  1. Support multiple routers configuration in router_config.yml
  2. Apply prioritization to routers
  3. Enable service level routers
    Which issue(s) this PR fixes:

Fixes #596

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

After this change, the local router configuration file needs to follow below pattern to support multiple routing rules in local file configuration:

routerRules: 
  - scope: application
    key: mock-app1
    priority: 1
    force: true
    conditions :
      - "a => b"
      - "c => d"
  - scope: application
    key: mock-app2
    priority: 1
    force: true
    conditions :
      - "a => b"
      - "c => d"

the scope defines the rule's applicable range, 'application' | 'service'
the key defines the rule's applicable application name(for application scope) or the service key(for service scope, [{group}/]{service}[:{version}])

@williamfeng323 williamfeng323 marked this pull request as draft July 18, 2020 16:18
cluster/router/condition/router_test.go Show resolved Hide resolved
config/router_config_test.go Outdated Show resolved Hide resolved
@williamfeng323 williamfeng323 force-pushed the feature/application-level-router branch from cc3554d to a41c36e Compare July 18, 2020 16:59
@codecov-commenter
Copy link

Codecov Report

Merging #662 into develop will increase coverage by 0.01%.
The diff coverage is 72.72%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #662      +/-   ##
===========================================
+ Coverage    63.80%   63.81%   +0.01%     
===========================================
  Files          236      236              
  Lines        12313    12329      +16     
===========================================
+ Hits          7856     7868      +12     
  Misses        3690     3690              
- Partials       767      771       +4     
Impacted Files Coverage Δ
cluster/router/tag/router_rule.go 71.42% <ø> (ø)
common/yaml/yaml.go 86.66% <0.00%> (-13.34%) ⬇️
config/consumer_config.go 56.25% <ø> (ø)
config/provider_config.go 58.06% <ø> (ø)
config/router_config.go 70.37% <73.33%> (-4.63%) ⬇️
cluster/router/condition/file.go 91.30% <100.00%> (+0.60%) ⬆️
cluster/router/condition/router_rule.go 84.61% <100.00%> (ø)
cluster/cluster_impl/base_cluster_invoker.go 61.11% <0.00%> (-9.73%) ⬇️
cluster/cluster_impl/failback_cluster_invoker.go 78.02% <0.00%> (-2.20%) ⬇️
protocol/dubbo/client.go 67.87% <0.00%> (-1.22%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6c39e2...b501734. Read the comment docs.

@williamfeng323 williamfeng323 changed the title [WIP]Ftr: Feature/application level router [WIP]Ftr: Feature/application and service level router Jul 26, 2020
@williamfeng323 williamfeng323 force-pushed the feature/application-level-router branch from b3b28d5 to 87ae81b Compare July 26, 2020 16:59
@williamfeng323 williamfeng323 force-pushed the feature/application-level-router branch from 87ae81b to b33167b Compare July 27, 2020 07:45
@zouyx zouyx linked an issue Jul 28, 2020 that may be closed by this pull request
@zouyx zouyx added this to the 1.5.1 milestone Jul 28, 2020
cluster/router/condition/file.go Outdated Show resolved Hide resolved
cluster/router/condition/file.go Outdated Show resolved Hide resolved
cluster/router/condition/file.go Show resolved Hide resolved
cluster/router/condition/router.go Show resolved Hide resolved
cluster/router/condition/router_rule.go Outdated Show resolved Hide resolved
config/router_config.go Show resolved Hide resolved
@williamfeng323 williamfeng323 marked this pull request as ready for review July 28, 2020 04:14
@zouyx zouyx changed the title [WIP]Ftr: Feature/application and service level router Ftr: Feature/application and service level router Jul 28, 2020
Copy link
Member

@zouyx zouyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about those problems ? Do you need to change ?

@williamfeng323 williamfeng323 force-pushed the feature/application-level-router branch from d38421d to 95e863e Compare August 7, 2020 08:38
@williamfeng323 williamfeng323 force-pushed the feature/application-level-router branch from b3811fe to 01910a0 Compare August 7, 2020 08:49
Copy link
Contributor

@fangyincheng fangyincheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pantianying pantianying merged commit 2aafdeb into apache:develop Aug 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aligh with Dubbo: Service route configuration
7 participants