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 Node.js client using API Keys authentication.
kcat
will be equal to token:<API KEY>
.You can follow the instructions to create an API key for the service account you choose to use.
Install the Kafka Nodejs client.
Build a Nodejs application to produce and consume messages.
SERVER-URL
: the Kafka service URL of your StreamNative cluster.API-KEY
: an API key of your service account.Run the Node.js application with your saved scripts.
This example runs the Node.js application assuming that you save the scripts as kop_test.js
.
You should see the following output:
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 Node.js client using API Keys authentication.
kcat
will be equal to token:<API KEY>
.You can follow the instructions to create an API key for the service account you choose to use.
Install the Kafka Nodejs client.
Build a Nodejs application to produce and consume messages.
SERVER-URL
: the Kafka service URL of your StreamNative cluster.API-KEY
: an API key of your service account.Run the Node.js application with your saved scripts.
This example runs the Node.js application assuming that you save the scripts as kop_test.js
.
You should see the following output: