Skip to main content
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

key
str
required
The key of the stream.
group
str
required
The consumer group name.
ids
*List[str]
required
One or more stream entry IDs to acknowledge and delete.
option
Literal['KEEPREF', 'DELREF', 'ACKED', 'keepref', 'delref', 'acked']
Optional deletion behavior (case-insensitive):
  • KEEPREF or keepref: Keep consumer group references
  • DELREF or delref: Delete consumer group references
  • ACKED or acked: Only acknowledge messages (don’t delete)

Response

A list of integers indicating the result for each ID in the same order as provided.
# Acknowledge and delete a single entry
result = redis.xackdel("mystream", "mygroup", "1638360173533-0")
print(result)  # List of results for each ID

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):
# Acknowledge the message
redis.xack("mystream", "mygroup", "123-0")
# Then delete it
redis.xdel("mystream", "123-0")
With XACKDEL (single atomic operation):
# Acknowledge and delete in one operation (default)
redis.xackdel("mystream", "mygroup", "123-0")

# With options for fine-grained control
redis.xackdel("mystream", "mygroup", "123-0", option="DELREF")  # Complete cleanup
redis.xackdel("mystream", "mygroup", "123-0", option="ACKED")   # Acknowledge only
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.