Skip to main content
Use XREADGROUP to read entries from a stream as a member of a consumer group, so that each entry goes to one consumer and Redis keeps track of what has not been acknowledged. After STREAMS, all keys come first and then one ID per key. The special ID > delivers entries that have never been delivered to the group and records them as pending for this consumer. Any other ID re-reads that consumer’s own pending entries instead, starting after the given ID, which is how a consumer resumes after a restart: read from 0 first to finish old work, then switch to >. The consumer is created on first use. COUNT limits the batch size and BLOCK <milliseconds> waits for new entries rather than returning empty, with 0 waiting indefinitely. NOACK skips the pending entries list entirely, trading the delivery guarantee for speed. Entries stay pending until acknowledged with XACK. That is what makes recovery possible: work left behind by a crashed consumer is visible in XPENDING and can be taken over with XAUTOCLAIM.

Syntax

Arguments

Important points

  • A blocking form holds the request until data arrives or its timeout expires. Set the client/network timeout longer than the command timeout.
  • After STREAMS, provide all keys first and then exactly one ID for each key, in the same order.

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.