Retrieve messages using commands available in Redis 3.

This commit is contained in:
Jon Chambers 2020-09-03 13:25:28 -04:00 committed by Jon Chambers
parent e48d37ccab
commit afd645fb11
1 changed files with 3 additions and 1 deletions

View File

@ -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());