Redis › Streams
How would you handle a message that was delivered to a consumer but never acknowledged, perhaps because that consumer crashed while processing it?
AdvancedAnswer
You use the XPENDING command to identify messages that have been delivered but not yet acknowledged, and XCLAIM to transfer ownership of a specific pending message to a different, healthy consumer after enough time has passed, ensuring that a crashed worker's unfinished work is not permanently lost and can be picked up by another available consumer.
XPENDING orders processing_group
XCLAIM orders processing_group worker2 60000 1725800000-0Real-world example A monitoring process periodically checks for messages that have been pending for too long using XPENDING, automatically reclaiming them with XCLAIM and assigning them to a healthy worker whenever the original consumer appears to have crashed.