Dubbo provides the service management capability of dynamic traffic isolation, which can dynamically isolate traffic without restarting the application.
Dubbo can implement traffic isolation through XML configuration, annotation configuration, and dynamic configuration. Here we mainly introduce the dynamic configuration method. For other configuration methods, please refer to the old document Configuration
Please make sure to run Dubbo-Admin successfully
If multiple versions of an application run simultaneously online and are deployed in different environments, such as daily environments and special environments, you can use label routing to isolate the traffic of different versions in different environments, and the order traffic of flash sales or orders from different channels Routing to special environments, routing normal traffic to everyday environments. Even if the special environment is abnormal, the traffic that should have entered the special environment will not enter the daily environment, and will not affect the use of the daily environment.
---
force: false
runtime: true
enabled: true
key: governance-tagrouter-provider
tags:
- name: tag1
addresses: ["127.0.0.1:20880"]
- name: tag2
addresses: ["127.0.0.1:20881"]
...
For the traffic isolation scenario, you only need to clarify the following issues to know how to write the configuration:
scope: application, key: app-name
(you can also use services
to specify certain services).addresses: ["0.0.0.0"]
or addresses: ["0.0.0.0:*"]
depends on the side value.addersses[list of instance addresses]
.Select the application related to the traffic isolation configuration to trigger the call verification.