# XGROUP

> Create, change and remove stream consumer groups and their consumers.

URL: https://docs.hotkv.com/commands/xgroup/

```
XGROUP subcommand [argument ...]
```

- Group: Stream
- HotKV Cloud: all plans
- On-Premise: no license needed

`XGROUP` is a container for the commands that manage consumer groups on a
stream. A consumer group lets several consumers share the work of reading a
stream: each entry goes to one consumer, and stays pending until it is
acknowledged.

## Subcommands

| Subcommand | What it does |
| --- | --- |
| [XGROUP CREATE](https://docs.hotkv.com/commands/xgroup-create/index.md) | Create a consumer group. |
| [XGROUP SETID](https://docs.hotkv.com/commands/xgroup-setid/index.md) | Set a group's last delivered ID. |
| [XGROUP DESTROY](https://docs.hotkv.com/commands/xgroup-destroy/index.md) | Delete a consumer group. |
| [XGROUP CREATECONSUMER](https://docs.hotkv.com/commands/xgroup-createconsumer/index.md) | Add a consumer to a group. |
| [XGROUP DELCONSUMER](https://docs.hotkv.com/commands/xgroup-delconsumer/index.md) | Remove a consumer and its pending entries. |
| `XGROUP HELP` | List the subcommands. |

An unknown subcommand replies
`ERR unknown subcommand 'name'. Try XGROUP HELP.`

## Examples

```
127.0.0.1:6379> XGROUP CREATE tasks workers $ MKSTREAM
OK
127.0.0.1:6379> XGROUP CREATECONSUMER tasks workers alice
(integer) 1
127.0.0.1:6379> XGROUP DESTROY tasks workers
(integer) 1
```

## Compatibility

Same subcommands as Redis 7 and Valkey 8.

## See also

[XREADGROUP](https://docs.hotkv.com/commands/xreadgroup/index.md), [XINFO](https://docs.hotkv.com/commands/xinfo/index.md), [XPENDING](https://docs.hotkv.com/commands/xpending/index.md)