diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java index 27bb2b32..c3811ba8 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java @@ -35,7 +35,7 @@ public class RedisRateLimiter implements RateLimiter { * @return */ @Override - //TODO: signature? params (tuple?). Return type, tokens left? + //TODO: signature? params (tuple?). public Response isAllowed(String id, int replenishRate, int burstCapacity) { try { @@ -46,7 +46,7 @@ public class RedisRateLimiter implements RateLimiter { List keys = Arrays.asList(prefix + ".tokens", prefix + ".timestamp"); // The arguments to the LUA script. time() returns unixtime in seconds. - String[] args = new String[]{ replenishRate+"", burstCapacity +"", Instant.now().getEpochSecond()+"", "1"}; + Object[] args = new String[]{ replenishRate+"", burstCapacity +"", Instant.now().getEpochSecond()+"", "1"}; // allowed, tokens_left = redis.eval(SCRIPT, keys, args) List results = this.redisTemplate.execute(this.script, keys, args);