I understand I can get the total length of a stream with xlen
or xinfo stream mystream full.
I also understand that I can use xpending
to get the length of the pending queue, items that have not been ack'd.
Is there a command to give me the count or identity of items that /have/ been ack
'd? (Besides assuming that xlen
- len(xpending)
= len(unackd)
?)
There's no built-in feature to count ack/processed messages in stream though you can accomplish this using LUA script and MULTI.
You can use the LUA script to count and ACK in the same flow.
my-stream
is the stream name andmy-group
is the consumer group name.You can also use Multi/Exec
I've tagged the counter and stream name to avoid cross slot errors in the Redis cluster. The counter is maintained for each consumer group and each stream.