A consumer group defines a group of consumers that read records from a topic in
parallel. Each consumer in the group is assigned a subset of the topic's
partitions to read from.

To create a consumer group or add a consumer to an existing group, set the
[`group.id`](https://kafka.apache.org/37/configuration/consumer-configs/#consumerconfigs_group.id)
configuration in the consumer. For example, when using the Kafka command-line
tools, you can specify the consumer group as follows:

```bash
kafka-console-consumer.sh \
  --topic TOPIC \
  --bootstrap-server BOOTSTRAP \
  --group GROUP \
  --consumer.config client.properties
```

Replace the following:

- `TOPIC`: the topic name.
- `BOOTSTRAP`: the bootstrap server.
- `GROUP`: the consumer group ID.

In Managed Service for Apache Kafka, you can manage consumer groups by using
the Google Cloud console, Google Cloud CLI, the client libraries, or the Kafka
command-line tools.

## What's next?

- [View a consumer group](https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/view-consumer-group.md.txt).

- [List a consumer group](https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/list-consumer-groups.md.txt).

- [Edit a consumer group](https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/edit-consumer-group.md.txt).

- [Delete a consumer group](https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/delete-consumer-group.md.txt).

*Apache Kafka® is a registered
trademark of The Apache Software Foundation or its affiliates in the United
States and/or other countries.*