diff --git a/src/main/java/org/swisspush/redisques/RedisQues.java b/src/main/java/org/swisspush/redisques/RedisQues.java index 4f7da1e..1566336 100644 --- a/src/main/java/org/swisspush/redisques/RedisQues.java +++ b/src/main/java/org/swisspush/redisques/RedisQues.java @@ -430,12 +430,12 @@ private void registerNotExpiredQueueCheck() { } String keysPattern = consumersPrefix + "*"; log.debug("RedisQues list not expired consumers keys:"); - redisProvider.redis().onSuccess(redisAPI -> redisAPI.keys(keysPattern, keysResult -> { - if (keysResult.failed() || keysResult.result() == null) { + redisProvider.redis().onSuccess(redisAPI -> redisAPI.scan(Arrays.asList("0", "MATCH", keysPattern, "COUNT", "1000"), keysResult -> { + if (keysResult.failed() || keysResult.result() == null || keysResult.result().size() != 2) { log.error("Unable to get redis keys of consumers", keysResult.cause()); return; } - Response keys = keysResult.result(); + Response keys = keysResult.result().get(1); if (keys == null || keys.size() == 0) { log.debug("0 not expired consumers keys found"); return; @@ -446,7 +446,7 @@ private void registerNotExpiredQueueCheck() { log.trace(response.toString()); } } - log.debug("{} not expired consumers keys found", keys.size()); + log.debug("{} not expired consumers keys found, {} keys in myQueues list", keys.size(), myQueues.size()); })) .onFailure(throwable -> log.error("Redis: Unable to get redis keys of consumers", throwable)); });