xgroup-setid.3valkey - Man Page
Sets the last-delivered ID of a consumer group.
Synopsis
XGROUP SETID
key group <id | $
> [ENTRIESREAD
entries-read]
Description
Set the last delivered ID for a consumer group.
Normally, a consumer group’s last delivered ID is set when the group is created with XGROUP CREATE
. The XGROUP SETID
command allows modifying the group’s last delivered ID, without having to delete and recreate the group. For instance if you want the consumers in a consumer group to re-process all the messages in a stream, you may want to set its next ID to 0:
XGROUP SETID mystream mygroup 0
The optional entries_read
argument can be specified to enable consumer group lag tracking for an arbitrary ID. An arbitrary ID is any ID that isn’t the ID of the stream’s first entry, its last entry or the zero (“0-0”) ID. This can be useful you know exactly how many entries are between the arbitrary ID (excluding it) and the stream’s last entry. In such cases, the entries_read
can be set to the stream’s entries_added
subtracted with the number of entries.
Reply
valkey-protocol(7) Simple string reply: OK
.
Complexity
O(1)
Acl Categories
@slow @stream @write
History
- Available since: 5.0.0
- Changed in 7.0.0: Added the optional
entries_read
argument.
See Also
xack(3valkey), 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), 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)