Upstash Documentation

XACKDEL

Acknowledge and delete stream entries atomically.
2 min read

The XACKDEL command acknowledges and deletes stream entries atomically in a single operation. This is useful for consumer groups where you want to acknowledge message processing and remove the entries from the stream simultaneously.

Arguments#

keystringrequired#

The key of the stream.

groupstringrequired#

The consumer group name.

option'KEEPREF' | 'keepref' | 'DELREF' | 'delref' | 'ACKED' | 'acked'#

Optional deletion behavior (case-insensitive). When provided, must come before the IDs:

  • KEEPREF: Keep consumer group references
  • DELREF: Delete consumer group references
  • ACKED: Only acknowledge messages (don't delete)

If not provided, entries are acknowledged and deleted by default.

ids...string[]required#

One or more stream entry IDs to acknowledge and delete. When an option is provided, IDs must come after the option.

Response#

Use Cases#

  • Message Queue Cleanup: Process messages and remove them from the stream in one operation
  • Event Processing: Acknowledge event handling and clean up the stream
  • Task Queue Management: Complete tasks and remove them atomically
  • Memory Optimization: Reduce stream memory usage by removing processed entries

Comparison with XACK + XDEL#

Traditional approach (two operations):

With XACKDEL (single atomic operation):

Note

This command is available in Redis 8.2.0 and later. It combines XACK and XDEL into a single atomic operation, which is more efficient and ensures consistency.