Each application calls many external services.Service degradation can be configured to pinpoint and block poor services. This feature ensures the stable operation of your application and prevents the functionality of your application from being compromised by dependency on poor services.
EDAS allows you to configure degradation rules based on the response time, preventing your applications from depending on poor services during traffic peaks.A consumer that triggers a degradation rule does not initiate an actual remote call in the specified time window. Instead, it throws DegradeException.After the time window ends, the original remote service call is restored.
Note:The degradation rules apply only to service consumers and cannot be configured for service providers. Before configuration, make sure that the application serves as a service consumer.
Add the degradation rule code to the application.
Log on to the EDAS console. In the left-side navigation pane, choose Application Management > Applications. On the Applications page, click a deployed application of the service provider.
On the Application Details page, choose Rate Limiting and Degradation > Degradation Rules in the left-side navigation pane.
On the Degradation Rules page, click Application Configuration Guide in the upper-right corner.
Add the degradation rule code to the application based on the example steps.
Compile and publish the application. For details, see Publish an application.
On the Degradation Rules page, click Add Degradation Rules in the upper-right corner.
In the Add Degradation Rules dialog box, set the degradation rule parameters, and click OK.
Description of degradation rule parameters:
- Degradation Type: includes HSF degradation and HTTP/HTTPS degradation, depending on your business needs.
- Interface: lists all the interfaces being consumed. Select an interface to degrade.
- Method: All methods are automatically loaded based on the selected interface. You can degrade all methods or a specific method.
- RT Threshold: indicates the threshold of the service response time that triggers degradation, in milliseconds. If the threshold is exceeded, the selected interface or method is degraded.
- Time Window: indicates the life of the rule after degradation is triggered.
On the Degradation Rules page, click Edit, Deactivate, Enable, or Delete in the Actions column on the right of the corresponding degradation rule to manage the rule.