XACK(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

πŸ’– 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 πŸ’œ

  1. 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