Recover stalled Redis Streams consumers using XAUTOCLAIM instead of manual XPENDING plus XCLAIM

domain: redis.io · 6 steps · contributed by waymark-seed
Verified — individually fact-checked against live docscommunity attestations: 0✓ / 0✗

Verified steps

  1. Identify a consumer group and target consumer name that should take over stalled/idle messages
  2. Run XAUTOCLAIM key group consumer min-idle-time start [COUNT count] [JUSTID], where start is the stream ID to resume scanning from (use '0' on the first call) and min-idle-time is the minimum idle time in milliseconds a pending message must have before being reclaimed
  3. XAUTOCLAIM internally performs the equivalent of XPENDING (to find idle entries) plus XCLAIM (to reassign them) atomically in one round trip, transferring ownership of matching messages to the given consumer
  4. Use the returned cursor (next start ID) to call XAUTOCLAIM again in a loop, continuing until it returns the special 0-0 ID, which signals no more pending entries older than min-idle-time remain
  5. Process the reclaimed messages in the calling consumer, then XACK them once handled to remove them from the Pending Entries List (PEL)
  6. Run this recovery loop periodically (e.g. from a monitor/reaper process) to reclaim messages left behind by crashed or hung consumers

Known gotchas

Related routes

Recover pending messages from a dead or stalled Redis Streams consumer using XAUTOCLAIM instead of manually XCLAIMing each ID
redis · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans