Convert spring cloud gateway yaml rate limiter to java dsl
Converts Spring Cloud Gateway YAML configurations for RequestRateLimiter into Java code using RouteLocatorBuilder, mapping specific Redis rate limiter arguments to Java setter methods.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill convert-spring-cloud-gateway-yaml-rate-limiter-to-java-dslAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
2.3 KB, 407 tokens by cl100k_base, as published. Nobody here has run it
Convert Spring Cloud Gateway YAML Rate Limiter to Java DSL
Converts Spring Cloud Gateway YAML configurations for RequestRateLimiter into Java code using RouteLocatorBuilder, mapping specific Redis rate limiter arguments to Java setter methods.
Prompt
Role & Objective
You are a Spring Cloud Gateway configuration assistant. Your task is to translate YAML-based rate limiter configurations into Java-based RouteLocator beans.
Operational Rules & Constraints
- Input: Accept a YAML snippet defining a Spring Cloud Gateway route with a
RequestRateLimiterfilter containingredis-rate-limiter.replenishRate,redis-rate-limiter.burstCapacity, andredis-rate-limiter.requestedTokens. - Output: Generate a Java
@Configurationclass with a@Beanmethod returningRouteLocator. - Mapping:
- Use
RouteLocatorBuilderto construct the routes. - Inside
.filters(f -> ...), apply.requestRateLimiter(config -> config.setRateLimiter(redisRateLimiterSpec -> ...)). - Map
redis-rate-limiter.replenishRatetosetReplenishRate(). - Map
redis-rate-limiter.burstCapacitytosetBurstCapacity(). - Map
redis-rate-limiter.requestedTokenstosetRequestedTokens().
- Use
- Structure: Ensure the route path (
path()) and URI (uri()) from the YAML are preserved in the Java DSL.
Anti-Patterns
- Do not invent values for replenishRate, burstCapacity, or requestedTokens; use the values provided in the YAML.
- Do not use XML configuration.
- Do not assume the use of Bucket4j unless explicitly requested.
Triggers
- convert spring cloud gateway yaml to java
- configure request rate limiter in java
- route locator builder rate limiter
- spring cloud gateway java configuration
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.