Develop a Python producer application
Learn how to develop a Python producer application that authenticates with a Managed Service for Apache Kafka cluster by using Application Default Credentials (ADC). ADC lets applications running on Google Cloud automatically find and use the right credentials for authenticating to Google Cloud services.
Before you begin
Before you start this tutorial, create a new Managed Service for Apache Kafka cluster. If you already have a cluster, you can skip this step.
How to create a cluster
Console
- Go to the Managed Service for Apache Kafka > Clusters page.
- Click Create.
- In the Cluster name box, enter a name for the cluster.
- In the Region list, select a location for the cluster.
-
For Network configuration, configure the subnet where the cluster is accessible:
- For Project, select your project.
- For Network, select the VPC network.
- For Subnet, select the subnet.
- Click Done.
- Click Create.
After you click Create, the cluster state is Creating. When the cluster
is ready, the state is Active.
gcloud
To create a Kafka cluster, run the
managed-kafka clusters
create command.