XACK(3valkey)
π XACK β the "okay we're DONE with this message bestie" command π
valkey command manual Β· section 3valkey Β· aka xack β¨
πΈ NAME πΈ
xack β returns the number of messages that were successfully acknowledged by the consumer group member of a stream. fr fr, that's the whole vibe. π
π¦ SYNOPSIS π¦
XACK key group ID [ID...]
π DESCRIPTION π
okay so. XACK removes one or multiple messages from the Pending Entries List β the PEL, bestie, say it with me β of a stream consumer group. π
A message is pending, and therefore sitting all cozy inside the PEL, when it was delivered to some consumer. That usually happens as a lil side effect of calling XREADGROUP, or when a consumer straight up took ownership of a message by calling XCLAIM. π«Ά
So like: the pending message was delivered to some consumer, but the server is not yet sure it was processed at least once. Which means β plot twist β new calls to XREADGROUP that go grab the messages history for a consumer (for instance using an ID of 0) will return that same message again. π And similarly, the pending message will be listed by the XPENDING command, which is the one that inspects the PEL. periodt.
Once a consumer successfully processes a message, it should call XACK so that message does not get processed again β and as a side effect, the PEL entry about that message is also purged, which releases memory from the Valkey server. slay, memory freed, we love to see it. β¨
π REPLY π
valkey-protocol(7) Integer reply: the command returns the number of messages successfully acknowledged.
heads up bestie π certain message IDs may no longer be part of the PEL β for example because they have already been acknowledged β and XACK will not count them as successfully acknowledged. no cap.
β COMPLEXITY β
O(1) for each message ID processed. tiny. iconic. π§
π ACL CATEGORIES π
@fast@stream@write
π HISTORY π
- Available since:
5.0.0
π₯ EXAMPLES π₯
127.0.0.1:6379> XACK mystream mygroup 1526569495631-0
(integer) 1
π SEE ALSO π
xadd(3valkey), xautoclaim(3valkey), xclaim(3valkey), xdel(3valkey), xgroup(3valkey), xgroup-create(3valkey), xgroup-createconsumer(3valkey), xgroup-delconsumer(3valkey), xgroup-destroy(3valkey), xgroup-help(3valkey), xgroup-setid(3valkey), xinfo(3valkey), xinfo-consumers(3valkey), xinfo-groups(3valkey), xinfo-help(3valkey), xinfo-stream(3valkey), xlen(3valkey), xpending(3valkey), xrange(3valkey), xread(3valkey), xreadgroup(3valkey), xrevrange(3valkey), xsetid(3valkey), xtrim(3valkey)
version 9.0.0 Β· dated 2025-10-21 Β· that's the whole page bestie, go ack some messages and hydrate ππ¦πΈβ¨π«Ά
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms