dubbo
dubbo copied to clipboard
[Feature]Extend a new ExpressionRouter which can be used for real expression like version=1.1 or version>=1.2
- [ x ] I have searched the issues of this repository and believe that this is not a duplicate.
- [ x ] I have checked the FAQ 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 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.