Hands-on task
Reclaim messages from a crashed worker
The stream jobs is processed by the group workers. Worker worker-old took several jobs and crashed — its messages have been sitting unacknowledged for a long time (over an hour). Worker worker-live is alive and is processing its job right now. Worker worker-slow is alive too — it has been computing a heavy report for about 30 minutes, which is normal for it.
Reassign to consumer worker-new all pending messages of the group that have been idle longer than 1 hour (3600000 ms), using XAUTOCLAIM. Then "process" them and acknowledge them.
Requirements:
worker-oldmust have no pending messages left;- don't touch the messages of
worker-liveandworker-slow— they must stay with their owners, unacknowledged; - don't change the stream itself: don't delete anything.
- redis
- streams
- XAUTOCLAIM
- XPENDING
- XACK
- consumer group