apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.32k stars 26.39k forks source link

Dynamic Routing Expansion #11297

Open kaori-seasons opened 1 year ago

kaori-seasons commented 1 year ago

Describe the feature

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.

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.

EarthChen commented 1 year ago

This feature may be as an spi extension better.

kaori-seasons commented 1 year ago

This feature may be as an spi extension better.

Yes, there is a draft for this and I'm working on its current 3.2 api. After passing ci, I will submit a demo to dubbo-samples