https://github.com/cunkz/nodejs-kafka-example
Example Kafka Producer and Consumer via NodeJS
https://github.com/cunkz/nodejs-kafka-example
kafka kafka-consumer kafka-producer nodejs nodejs-example
Last synced: 10 months ago
JSON representation
Example Kafka Producer and Consumer via NodeJS
- Host: GitHub
- URL: https://github.com/cunkz/nodejs-kafka-example
- Owner: cunkz
- License: mit
- Created: 2024-05-30T02:47:13.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-04T05:42:46.000Z (over 1 year ago)
- Last Synced: 2025-01-25T08:26:31.534Z (12 months ago)
- Topics: kafka, kafka-consumer, kafka-producer, nodejs, nodejs-example
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kafka Producer and Consumer NodeJS Example
This repository contains examples of using Kafka Producer and Consumer via NodeJS.
## Usage
First, create Kafka Topic then install nodejs module. Copy `.env.example` file into `.env` and fill value for each environment variable.
Then, execute file `bin/consumer.js` to listen new message from topic based `.env` configuration. Open new terminal, execute file `bin/producer.js` to send single message into your topic and watch first terminal to check if message has been received.
## Authenticate with SASL
Apache Kafka® brokers support client authentication using SASL. SASL authentication can be enabled concurrently with TLS/SSL encryption. Currently this example only support SASL/Plain.