Retrieve messages using commands available in Redis 3.
This commit is contained in:
parent
e48d37ccab
commit
afd645fb11
|
@ -80,7 +80,9 @@ public class ScourMessageCacheCommand extends ConfiguredCommand<WhisperServerCon
|
||||||
List<ScoredValue<byte[]>> messages;
|
List<ScoredValue<byte[]>> messages;
|
||||||
|
|
||||||
do {
|
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) {
|
for (final ScoredValue<byte[]> scoredValue : messages) {
|
||||||
persistMessage(accountNumber, deviceId, scoredValue.getValue());
|
persistMessage(accountNumber, deviceId, scoredValue.getValue());
|
||||||
|
|
Loading…
Reference in New Issue