XACK
XACK key group id [id ...]
- Group
- Stream
- Complexity
- O(1) per ID
- Arity
- -4 (at least 4 words, counting the command name)
- Flags
- write, fast
- Keys
- first 1, last 1, step 1
- HotKV Cloud
- All plans
- On-Premise
- no license needed
XACK marks entries as processed for the consumer group group: they are
removed from the group’s pending entries list, whichever consumer held them.
It returns how many of the IDs were pending and are now acknowledged.
Acknowledging does not delete the entries from the stream. Use XDEL or XTRIM for that.
When the stream and the group exist, all IDs are checked before any is acknowledged.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Always | Integer: the number of entries acknowledged | Integer |
The reply is 0 when the key or the group does not exist, or when none of
the IDs was pending.
Error replies: ERR Invalid stream ID specified as stream command argument,
and WRONGTYPE if the key holds another type.
Examples
Section titled “Examples”127.0.0.1:6379> XADD tasks 1700000000000-0 job email"1700000000000-0"127.0.0.1:6379> XGROUP CREATE tasks workers 0OK127.0.0.1:6379> XREADGROUP GROUP workers alice STREAMS tasks >1) 1) "tasks" 2) 1) 1) "1700000000000-0" 2) 1) "job" 2) "email"127.0.0.1:6379> XACK tasks workers 1700000000000-0(integer) 1127.0.0.1:6379> XACK tasks workers 1700000000000-0(integer) 0Compatibility
Section titled “Compatibility”Same as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.