Service Throttling FAQ

Updated at:

This topic answers common questions about the service throttling feature.

Why is my service throttling configuration not working?

Troubleshoot the issue as follows:

  1. Confirm that your SOFA version is 3.3.0 or later. If not, upgrade the version.

    For more information about SOFA versions, see Version Guide.

  2. Integrate the dynamic configuration client and service throttling.

    <dependency>
        <groupId>com.alipay.sofa</groupId>
        <artifactId>ddcs-enterprise-sofa-boot-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>com.alipay.sofa</groupId>
        <artifactId>guardian-sofa-boot-starter</artifactId>
    </dependency>
  3. Confirm that the customer is using rate limiting for the REST protocol as follows:

    1. Check the code and validate the Facade interface, implementation class, and XML configuration. The interface is defined as follows:接口.png

    2. In the XML file, configure the bean for the implementation class and publish the service with the REST protocol.xml配置.png

  4. Deploy the application to CAFE for testing. The steps are as follows:

    1. After the deployment is complete, check the Guardian guardian-default.log file to confirm that the Guardian component is registered.guardian-log.png

    2. Configure the throttling conditions in the SOFA console.

      The application name in the configuration must match the value of spring.application.name in the application.properties file.配置值.png

    3. After completing the configuration, enable service throttling again.

    4. Check the Guardian guardian-default.log file to confirm that the application has logged the configuration information, as shown below:日志打印.png

    5. After confirming that the information is correct, access the application in a browser to verify the result. You can check the guardian-limit-stat.log file to view successful requests.stat日志.png

Why is there no service throttling log file directory in the configured logs folder?

Add a custom path in the startup class. The service throttling log files are then generated in the specified directory. For example: System.setProperty("user.home","/tmp/localfile")

Why does Guardian not load when the application starts?

Symptom:

When the application starts, Guardian does not load and the log directory is not created.

Cause:

The Guardian JAR package was not included when the application was packaged.

Solution:

When you package the application, make sure to include the Guardian JAR package.