Quick Starts
Connect to your cluster using the Kafka Python client
This QuickStart assumes that you have created a StreamNative cluster with the Kafka protocol enabled, created a service account, and granted the service account produce
and consume
permissions to a namespace for the target topic.
This document describes how to connect to your StreamNative cluster using the Kafka Python client using API Keys authentication.
Before you begin
- Before using an API key, verify that the service account is authorized to access the resources, such as tenants, namespaces, and topics.
- The password for different utilities as
kcat
will be equal totoken:<API KEY>
.
You can follow the instructions to create an API key for the service account you choose to use.
Steps
-
Install the Kafka Python client.
-
Build a Python application to produce and consume messages.
SERVER-URL
: the Kafka service URL of your StreamNative cluster.YOUR-API-KEY
: an API key of your service account.
-
Run the Python application and you should see the following output: