Skip to content

ApiCartOps/kafka_sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript Producer Simple

This project contains a confluent-kafka-javascript application that produces string values to a topic in Confluent Cloud. Of note: this project uses the promisified API similar to KafkaJS, see the migration guide for more details on the differences between it and KafkaJS.

Getting Started

Prerequisites

It's assumed that you have node and npm installed. Node must be a version >=18.0.0 to install confluent-kafka-javascript.

Another assumption: that you have set up a cluster in the Confluent Cloud environment with a topic, a bootstrap server, and you have created an api key and secret. Follow the instructions in the Confluent documentation if you are unsure of how to do this.

Installation

To install the dependencies:

npm install

Usage

Run this command to start the producer:

node producer.js

You will also likely want to add a serializer when you customize the message produced. There is some more information about how to do this using the confluent-kafka-javascript client here.

Contact

Lucia Cerchie - lcerchie@confluent.io

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors