XACKDEL
XACKDEL key group [KEEPREF | DELREF | ACKED] IDS numids id [id ...]
- Available since:
- Redis Open Source 8.2.0
- Time complexity:
- O(1) for each entry ID processed.
- ACL categories:
-
@write
,@stream
,@fast
,
Acknowledges and conditionally deletes one or multiple entries (messages) for a stream consumer group at the specified key
.
XACKDEL
combines the functionality of XACK
and XDEL
in Redis Streams. It acknowledges the specified entry IDs in the given consumer group and simultaneously attempts to delete the corresponding entries from the stream.
Required arguments
key
The name of the stream key.
group
The name of the consumer group.
IDS numids id [id ...]
The IDS block specifying which entries to acknowledge and delete:
numids
: The number of IDs that followid [id ...]
: One or more stream entry IDs to acknowledge and delete
Optional arguments
KEEPREF | DELREF | ACKED
Specifies how to handle consumer group references when acknowledging and deleting entries. Available since Redis 8.2. If no option is specified, KEEPREF
is used by default:
KEEPREF
(default): Acknowledges the entries in the specified consumer group and deletes the entries from the stream, but preserves existing references to these entries in all consumer groups' PEL (Pending Entries List).DELREF
: Acknowledges the entries in the specified consumer group, deletes the entries from the stream, and also removes all references to these entries from all consumer groups' pending entry lists, effectively cleaning up all traces of the entries. If an entry ID is not in the stream, but there are dangling references,XACKDEL
withDELREF
would still remove all those references.ACKED
: Acknowledges the entries in the specified consumer group and only deletes entries that were read and acknowledged by all consumer groups.
This command is particularly useful when you want to both acknowledge entry processing and clean up the stream in a single atomic operation, providing fine-grained control over how entry references are handled.
XACKDEL
with the ACKED
option instead of XACK
and XDEL
, simplifying the application logic.Examples
Return information
One of the following:
- Array reply: -1 for each requested ID when the given key does not exist.
- Array reply: For each ID:
- Integer reply: 1 if the entry was acknowledged and deleted from the stream.
- Integer reply: -1 if no such ID exists in the provided stream key.
- Integer reply: 2 if the entry was acknowledged but not deleted, as there are still dangling references (ACKED option).