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

How can set the zuul ratelimit filter for group of users other than the user with name xxxx

yangw14 opened this issue · comments

I want to set the zuul rate limit as:
for the user a, set no rate limitation(or a big number).
for other users(more than 100K), set the rate limit as, for example, 3.

I found current zuul matches the USER type by the equals method.
and multiple policies for a single serviceId are validated one by one.

based on this rule, I need to set a policy as user=a
and need to set another policy as user != a, but '!=' is not supported.

If I set a policy with "user" without any value. and set the limit as 3
and then set a policy with 'user=a' type with limit=99999, when I sent a request with user a, the first policy is also be validated, so the request I sent in the refresh_interval can't exceed 3.

Or is there some way that I can disable the zuul ratelimit for a specific user?

any idea about this? Thanks in advance!

Hello @yangw14, thanks for getting in touch, we will get back to you asap! If you have issues in the 1.x.x.RELEASE line we recommend you to update to the latest version, unfortunately this line is not supported anymore.

Finally I found this is breakOnMatch can used to solve my problem.
catalogProxy:
- limit: 999999
quota: 1000
refresh-interval: 60
breakOnMatch: true
type:
- origin
- user=unlimited-user
Thanks.