edit-icon download-icon

Rate limiting

Last Updated: Feb 02, 2019

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 degradation rules

  1. Add the degradation rule code to the application.

    1. 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.

    2. On the Application Details page, choose Rate Limiting and Degradation > Degradation Rules in the left-side navigation pane.

    3. On the Degradation Rules page, click Application Configuration Guide in the upper-right corner.

    4. Add the degradation rule code to the application based on the example steps.

  2. Compile and publish the application. For details, see Publish an application.

  3. On the Degradation Rules page, click Add Degradation Rules in the upper-right corner.

  4. 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.

Manage degradation rules

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.

Thank you! We've received your feedback.