Using Redis 5.0.3, let's say we create a stream called streamy and a consumer group consumers:
XGROUP CREATE streamy consumers $ MKSTREAM
Then add a few messages to it:
XADD streamy * message "The beginning"
XADD streamy * message "The middle"
XADD streamy * message "The end"
And finally read and acknowledge the first one:
XREADGROUP GROUP consumers consumer1 COUNT 1 STREAMS streamy >
XACK streamy consumers 1612270017551-0
I know I can use XLEN streamy to get the total number of messages (3), and XINFO CONSUMERS streamy consumers to get the number of pending messages for each consumer (0).
But how can I find the number of unread messages (2), or the number of acknowledged messages (1), whichever is easiest to find?
Also, given a specific message ID, is there any way to check if that message has been read and/or acknowledged?