apache / apache/dubbo

[Feature]Extend a new ExpressionRouter which can be used for real expression like version=1.1 or version>=1.2

Open
#6,233 0 comments 0 reactions 0 assignees View on GitHub
type/proposal
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

- [ x ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
- [ x ] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: all
* Operating System version: all
* Java version: 1.8+

### Current pain point:

ConditionRouter only supports a few operators which cannot satisfy real usage in production.
Now canary deployment is popular in micro services and Dubbo should have a native solution.

Pls. provide [GitHub address] to reproduce this issue.

https://github.com/vipweihua/dubbo

### Expected Result

So here comes the feature:
Users can specify the rules in config center such like following:
when c.version==1.1 then s.version>=2.0
when c.version<1.1 then s.version<2.0
c is an embeded object which means client/consumer, s means server/provider
As soon as the rules are deployed, it will be applied into the consumer side and changes the router.
More complicated expressions, please refer to [Apache Commons JEXL](https://commons.apache.org/proper/commons-jexl/)
This expression language can be easily changed to Spring Expression Language(SpEL). But consider that dubbo is now and apache project, commons-jexl will be used as the default one.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing Dubbo's existing ConditionRouter behavior and the linked reproduction repository. Compare its current operators with the proposed consumer and provider expressions, then define how config-center rule changes should update routing and how the supported expression language will be selected; done means the documented examples work end to end.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.