spring-cloud/spring-cloud-gateway

Allow making replenishRate float?

オープン

#2,145 opened on 2021/02/13

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)Java (3,204 件のフォーク)batch import
enhancementhelp wanted

Repository metrics

Stars
 (4,284 個のスター)
PR merge metrics
 (PR metrics pending)

説明

Hello! In some cases it can be useful to make replenishRate float (special cases when 0<replenishRate< 1). So we will be able for example to increase value in the bucket by values < 1 every second (so value 0.1 means to fulfill bucket with 1 token every 10 seconds).

No code changes has be made for lua script to do this, only for config class.

https://github.com/spring-cloud/spring-cloud-gateway/blob/16808fbef751404192edc1d66b52fac6defcd9fb/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java#L318

コントリビューターガイド