Skip to main content
Use XAUTOCLAIM to transfer ownership of pending entries that have been idle for too long, without having to name their IDs. Starting from <start>, it walks the group’s pending entries list and claims for <consumer> every entry that has been idle at least <min-idle-time> milliseconds, up to COUNT of them. The reply has three parts: a cursor to pass as <start> on the next call, the claimed entries themselves (or only their IDs with JUSTID), and the IDs that were dropped from the pending list because they no longer exist in the stream. This is the recommended way to recover work from a consumer that crashed or stalled: it replaces the older loop of XPENDING to find idle entries followed by XCLAIM to take them, and it can be run repeatedly by a janitor task, since the idle threshold keeps healthy consumers’ work untouched.

Syntax

Arguments

Response

The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.
Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.

Examples

TCP examples use the TLS REDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.

Related topics

XAUTOCLAIMOverview