To protect your Spring Cloud Zuul application, integrate it with AHAS gateway protection using an SDK. This allows you to configure throttling rules to ensure application stability.
Procedure
Log in to the AHAS console. In the upper-left corner of the page, select a region.
In the left-side navigation pane, choose .
- On the Gateway Protection page, click Gateway Access in the upper-right corner. Then, select the Zuul (1.x) Gateway Access tab.
- In the pom.xml file of your Spring Cloud Zuul application, add the following dependency:
<dependency> <groupId>com.alibaba.csp</groupId> <artifactId>spring-cloud-zuul-starter-ahas-sentinel</artifactId> <version>x.y.z</version> </dependency>Note Replacex.y.zwith the latest dependency version, which is available on the Zuul (1.x) Gateway Access tab.
- Configure the startup parameters for the application using one of the following methods.
- Add JVM -D parameters.
- For a private network environment, add the following parameter:
// Replace AppName with your custom application name. -Dproject.name=AppName - For an Internet-facing environment, add the following parameters:
// Replace AppName with your custom application name and <license> with your actual license. -Dproject.name=AppName -Dahas.license=<license>
- For a private network environment, add the following parameter:
- Modify the Spring properties file. In the application.properties file, add the following parameters:
- For a private network environment, add the following parameters:
# Specify the AHAS environment to integrate with. ahas.namespace=default # Specify your custom application name. project.name=AppName - For an Internet-facing environment, add the following parameters:
# Specify the AHAS environment to integrate with. ahas.namespace=default # Specify your custom application name. project.name=AppName # Configure the license information. ahas.license=<license>
- For a private network environment, add the following parameters:
For deployments in an Internet-facing environment, you must provide a license. You can find your license in the Step 2: Configure startup parameters section. Deployments in private network environments do not require a license. For more information, see View your license.

- Add JVM -D parameters.
- Restart your gateway application.
Verify the integration
Log in to the AHAS console. In the left-side navigation pane, choose . If a resource card for your gateway application appears on the Gateway Protection page, the integration is successful.

Next steps
After integrating the gateway application, you can configure gateway throttling rules for it.