marcosbarbero / spring-cloud-zuul-ratelimit

Rate limit auto-configure for Spring Cloud Netflix Zuul

Home Page:https://blog.marcosbarbero.com/spring-cloud-netflix-zuul-rate-limit/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rate limit entire application by a single policy

sharunthomas opened this issue · comments

Describe the question

  1. I want to enable rate limit for the entire application, so I created zuul properties like below.
    But not working. Please comment a solution.
    Now I kind of need to add multiple policies to rate limit my entire application!
  2. What is zuul.ratelimit.behind-proxy=true means ?

Additional context

zuul.ratelimit.behind-proxy=true
zuul.routes.defaultRoute.path=/api/**
zuul.routes.defaultRoute.url=forward:/

zuul.ratelimit.policy-list.defaultRoute[0].limit=2
zuul.ratelimit.policy-list.defaultRoute[0].refresh-interval=60
zuul.ratelimit.policy-list.defaultRoute[0].type[0]=user

Why url_pattern gives error

Property: zuul.ratelimit.defaultPolicyList[0].type[1]
    Value: url_pattern=/api/*
    Reason: Failed to convert property value of type 'java.lang.String' to required type 'com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.properties.RateLimitProperties$Policy$MatchType' for property 'defaultPolicyList[0].type[1]'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [@javax.validation.Valid @javax.validation.constraints.NotNull com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.properties.RateLimitProperties$Policy$MatchType]

I'm using 1.7X spring cloud rate limiter