gcloud managed-kafka consumer-groups update (CONSUMER_GROUP : --cluster=CLUSTER --location=LOCATION) --topics-file=JSON|YAML|FILE [GCLOUD_WIDE_FLAG …]
$gcloud managed-kafka consumer-groups update myconsumergroup | --cluster=mycluster \ --location=us-central1 \ --topics-file=topics.json
To update the topics of a consumer group with inline JSON, run the following:
$gcloud managed-kafka consumer-groups update myconsumergroup | --cluster=mycluster \ --location=us-central1 \ --topics-file='{"topic":{"partitions":{"0":{"offset":1,"metadata":"metadata"}}}}'
To set the project attribute:
consumer_group on the command line with a
fully specified name;
--project on the command line;
core/project.
CONSUMER_GROUP
To set the consumer_group attribute:
consumer_group on the command line.
--cluster=CLUSTERcluster attribute:
consumer_group on the command line with a
fully specified name;
--cluster on the command line.
--location=LOCATIONlocation attribute:
consumer_group on the command line with a
fully specified name;
--location on the command line.
--topics-file=JSON|YAML|FILEtopics_file value.
Input Example:
--topics-file=string
File Example:
--topics-file=path_to_file.(yaml|json)
--access-token-file,
--account, --billing-project,
--configuration,
--flags-file,
--flatten, --format, --help, --impersonate-service-account,
--log-http,
--project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run $ gcloud help for details.
managedkafka/v1 API. The full documentation
for this API can be found at: https://cloud.google.com/managed-service-for-apache-kafka/docs
gcloud alpha managed-kafka consumer-groups updategcloud beta managed-kafka consumer-groups update
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.