Consumer groups, and the pending entries list

Reading a stream directly gives every consumer every message. A consumer group distributes entries between members and remembers which ones were handed out and not acknowledged.

XGROUP CREATE orders workers 0

# '>' means "entries never delivered to this group"
XREADGROUP GROUP workers worker-1 COUNT 10 BLOCK 5000 STREAMS orders '>'

# ... do the work ...
XACK orders workers 1542195600000-0

# what is outstanding, and for how long
XPENDING orders workers

The pending entries list is the whole mechanism: an entry delivered and not acknowledged stays there indefinitely, which is what makes recovery possible after a consumer dies. Reading with an explicit id rather than > returns that consumer’s own pending entries, which is how a restarted worker picks up where it left off. Forgetting XACK produces a system that works perfectly and accumulates an unbounded pending list.