Delete stream message(s) with extended options
XDELEX key
[KEEPREF |
DELREF |
ACKED] IDS
numids id [id…]
The XDELEX command is an extension of the XDEL command that deletes one or more stream
messages with control over how deletion affects consumer groups.
The command supports three deletion modes:
KEEPREF (default): deletes the stream message but
leaves pending entries list (PEL) references intact in all consumer
groups,DELREF: deletes the stream message and forcibly removes
it from all consumer group PELs,ACKED: deletes a message only once no consumer group
still needs it, meaning none has it pending (each has either
acknowledged it or never picked it up), and no group can still deliver
it later.Array of integer codes, one per requested ID, in the same order as the IDs are given.
ACKED mode only).O(1) for each single item to delete in the stream, regardless of the stream size
@fast @stream @write
127.0.0.1:6899> XADD s4 * a 1
"1788346731590-0"
127.0.0.1:6899> XGROUP CREATE s4 grp 0
OK
127.0.0.1:6899> XREADGROUP GROUP grp cons1 COUNT 10 STREAMS s4 >
1) 1) "s4"
2) 1) 1) "1788346731590-0"
2) 1) "a"
2) "1"
127.0.0.1:6899> XDELEX s4 ACKED IDS 1 1788346731590-0
1) (integer) 2
127.0.0.1:6899> XLEN s4
(integer) 1
127.0.0.1:6899> XACK s4 grp 1788346731590-0
(integer) 1
127.0.0.1:6899> XDELEX s4 ACKED IDS 1 1788346731590-0
1) (integer) 1
127.0.0.1:6899> XLEN s4
(integer) 0
XACK, XACKDEL, XADD, XAUTOCLAIM, XCLAIM, XDEL, XGROUP, XGROUP CREATE, XGROUP CREATECONSUMER, XGROUP DELCONSUMER, XGROUP DESTROY, XGROUP HELP, XGROUP SETID, XINFO, XINFO CONSUMERS, XINFO GROUPS, XINFO HELP, XINFO STREAM, XLEN, XPENDING, XRANGE, XREAD, XREADGROUP, XREVRANGE, XSETID, XTRIM.