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 application 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 a degradation rule
Add the degradation rule code.
Log on to the EDAS Console, click Applications in the left-side navigation pane to go to the application list page, and select a deployed application of the service provider to go to the application details page.
Select Rate Limiting and Degradation > Degradation Rules from the left-side menu bar of the application details page.
Click Application Configuration Guide in the upper-right corner of the degradation rule page.
Add the degradation rule code by following the steps in the application configuration guide.
Compile and publish the application. For details, see Publish an application.
Click Add Degradation Rules in the upper right corner of the degradation rule page.
In the displayed Add Degradation Rule dialog box, set the degradation rule parameters.
Description of the degradation rule parameters:
- Degradation Type: This parameter can be set to "HSF" or "HTTP". Select a specific degradation type based on the access type of the application.
- Interface: All interfaces that the consumer is consuming are listed. Select the interface to be degraded as required.
- Method: All methods are automatically loaded based on the selected interface. You can select whether to degrade all methods or a specific method as required.
- RT Threshold: The threshold of the service response time that triggers degradation, in ms. If this threshold is exceeded, the selected interface or method is degraded.
- Time Window: The duration for which the rule lasts after degradation is triggered.
After the above settings, click OK.
Manage degradation rules
On the Degradation Rules page, you can Edit, Stop, Start or Delete a rule.