Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

XGROUP SETID

Last updated
XGROUP SETID key group <id | $> [ENTRIESREAD entries-read]
Group
Stream
Complexity
O(1)
Arity
-5 (at least 5 words, counting the command name)
HotKV Cloud
All plans
On-Premise
no license needed

XGROUP SETID moves the consumer group’s last delivered ID. The next XREADGROUP with > delivers entries after it. Set it to 0 to have the group read the whole stream again, or to $ to skip everything already in the stream.

The pending entries list is not changed.

Option Effect
ENTRIESREAD entries-read Set the group’s count of entries read, used for its lag in XINFO GROUPS. -1 means unknown.
Case RESP2 RESP3
ID set Simple string OK Simple string OK

Error replies:

  • NOGROUP No such consumer group 'group' for key name 'key'
  • ERR The XGROUP subcommand requires the key to exist. ... when the stream does not exist.
  • ERR Invalid stream ID specified as stream command argument
  • ERR value for ENTRIESREAD must be positive or -1
  • ERR unknown subcommand or wrong number of arguments for 'SETID'. Try XGROUP HELP.
  • WRONGTYPE if the key holds another type.
127.0.0.1:6379> XADD orders 1700000000000-0 item book
"1700000000000-0"
127.0.0.1:6379> XGROUP CREATE orders billing $
OK
127.0.0.1:6379> XREADGROUP GROUP billing w1 STREAMS orders >
(nil)
127.0.0.1:6379> XGROUP SETID orders billing 0
OK
127.0.0.1:6379> XREADGROUP GROUP billing w1 STREAMS orders >
1) 1) "orders"
2) 1) 1) "1700000000000-0"
2) 1) "item"
2) "book"

Same as Redis 7 and Valkey 8.

XGROUP CREATE, XGROUP, XINFO GROUPS