Retrieve messages using commands available in Redis 3.

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2020-09-03 13:31:55 -04:00
1 parent e48d37ccab
commit afd645fb11
1 file changed
+3 -1
@@ -80,7 +80,9 @@ public class ScourMessageCacheCommand extends ConfiguredCommand<WhisperServerCon
List<ScoredValue<byte[]>> messages;
do {
messages = redisClient.withBinaryClient(connection -> connection.sync().zpopmin(queueKeyBytes, MESSAGE_PAGE_SIZE));
final int start = messageCount;
messages = redisClient.withBinaryClient(connection -> connection.sync().zrangeWithScores(queueKeyBytes, start, start + MESSAGE_PAGE_SIZE));
for (final ScoredValue<byte[]> scoredValue : messages) {
persistMessage(accountNumber, deviceId, scoredValue.getValue());