What's new in Valkey 9.0? Discover new features and improvements. Read the announcement.

XGROUP CREATECONSUMER

Creates a consumer in a consumer group.

Usage
XGROUP CREATECONSUMER key group consumer
Complexity
O(1)
Since
6.2.0
ACL Categories
@slow, @stream, @write
Command flags
WRITE, DENYOOM

Create a consumer named <consumername> in the consumer group <groupname> of the stream that's stored at <key>.

Consumers are also created automatically whenever an operation, such as XREADGROUP, references a consumer that doesn't exist. This is valid for XREADGROUP only when there is data in the stream.

Replies

RESP2

Integer reply: the number of created consumers, either 0 or 1.

RESP3

Integer reply: the number of created consumers, either 0 or 1.