Routing is the core traffic control mechanism in Dubbo. Based on it, we can implement canary releases, proportional traffic forwarding, same-region prioritization, full-link grayscale, and other traffic strategies. The design and basic principles of the routing (Router) mechanism in Dubbo, along with several built-in routing rules.
The built-in traffic strategies in Dubbo are very flexible, but there is also a certain understanding and usage cost. Therefore, we summarize some common usage scenarios and provide configuration methods:
Scenario | Effect | Target | Description |
---|---|---|---|
Timeout | |||
Access Log | |||
Call Retry |
Next, let’s take a conditional routing example to see how to use the Dubbo traffic control mechanism.
The requirements are very straightforward.
This is implemented in Dubbo through conditional routing, and its detailed working principle is explained in our introduction. In the above example, xxx represents; yyy represents.
We need to deploy the rules to the running Dubbo SDK. In the Dubbo system, this is done as follows.
A zk/nacos distributes a rule, and the Dubbo instance receives the rule push. During the RPC call, rules are applied to filter, selecting a subset of addresses to call.
At this point, if we send a request to the xxx service,
There is one very important point.