spring-cloud/spring-cloud-gateway

Allow making replenishRate float?

开放

#2,145 创建于 2021年2月13日

 (1 条评论) (0 个反应) (0 位负责人)Java (3,204 个派生)batch import
enhancementhelp wanted

仓库指标

星标
 (4,284 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南