What order are the messages returned with the xpending command?

43 views Asked by At

I have an application that I built using spring boot and it reads from a redis-stream. I am calling the xpending operation via spring boot's helper "opsForStream()" api - it looks like this:

private PendingMessages getPending() {
    return this.redisTransactionTemplate.opsForStream().pending(streamKey, groupName, Range.unbounded(), 1000);
}

I then want to take these 1000 (or less) pending messages and then call xrange. However, I'm not sure if these pending messages are in order from earliest to latest. I want to ideally use the pending messages in order but I don't want to assume that these are in order.

Does anyone know if I can assume that the first item in the pending messages is the earliest message in the PEL and the last message is the latest?

0

There are 0 answers