During peak hours, a downstream service provider may run into a performance bottleneck that even affects the business. In this case, you can use the service degradation feature to degrade some service consumers. By using this feature, unimportant service consumers do not call the service. Instead, mocked responses are directly returned. Valuable resources of the downstream service provider are reserved for important service consumers. This way, the overall service stability is improved.

Create a service degradation rule

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, choose Microservices Governance > Dubbo.
  3. In the navigation tree of the Dubbo page, click Service Degradation.
  4. In the top navigation bar, select a region. On the Service Degradation page, select a microservice namespace. Then, click Create downgrade rules.
  5. In the Create downgrade rules panel, set the parameters and click OK.
    Create a service degradation rule for a Dubbo application

    The following table describes the parameters.

    Parameter Description
    Microservice Space Select the region and microservice namespace where the application resides.
    Rule name Enter a name for the service degradation rule. The name can be up to 64 characters in length, and can contain letters, digits, underscores (_), and hyphens (-).
    Description Enter a description for the service degradation rule.
    Service Provider Application Select the application that can be called by other applications.
    Downgrade service consumer applications Select the application that you want to downgrade.
    Service Degradation Rule List Click Add service downgrade rules to create a service degradation rule.
    Frame type Select Dubbo.
    Service method Select the application that you select from the Service Provider Application drop-down list and select the interface that is used to call the application.
    Effective strategy Select the policy based on which the service degradation rule takes effect. Valid values: Effective for all requests and Effective for abnormal requests.
    App to be downgraded Select the policy for the service degradation rule. If the rule is triggered, the specified content is returned. Valid values: Return Null, Return Exception, and Return custom Json data.
    Default state Turn on or off the switch to enable or disable the rule.
    • On: enables the rule after it is created. By default, the switch is turned on.
    • Off: disables the rule after it is created. To enable the rule, find the rule on the Service Degradation page and click Enable in the Operation column.

Result

After you create and enable the service degradation rule, check whether the rule takes effect.

What to do next

After you create the service degradation rule, you can modify the rule. You can disable or enable the rule based on the status of the rule. If you no longer need to use the rule, you can delete it.