https://github.com/fjord-framework/producer
Kafka producer to simulate producing records into a Fjord user's cluster
https://github.com/fjord-framework/producer
api-proxy aws kafka kafka-producer real-time sse
Last synced: 12 months ago
JSON representation
Kafka producer to simulate producing records into a Fjord user's cluster
- Host: GitHub
- URL: https://github.com/fjord-framework/producer
- Owner: fjord-framework
- License: mit
- Created: 2021-08-04T22:59:33.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-24T21:14:15.000Z (over 4 years ago)
- Last Synced: 2025-01-20T19:16:03.613Z (about 1 year ago)
- Topics: api-proxy, aws, kafka, kafka-producer, real-time, sse
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Test Producer
This repository contains three `.js` scripts that can be used to test the production of records into a Kafka cluster.
1. `producer.js` is the simplest script. Run it to test the production of one record into a cluster. Sample usage: `node producer.js stocks ko 125`. The arguments passed represent the Kafka topic, the record key, and the record value.
2. `batch.js` produces a one-time batch of records into a cluster. Sample usage: `node batch.js stocks 1000`. Here, the arguments represent the topic and the number of records. The key will be a random number between 1 and 10, and the value will be a combination of the topic, time in milliseconds, and record number as it's created in the program.
3. `interval.js` produces a specified number of records per second into the cluster. Sample usage: `node interval.js stocks 10`. The arguments here represent the Kafka topic and the number of records you want to producer per second.
Be sure to include a `.env` file with the following environmental variables:
```
CLIENT=
BROKERS=
KAFKA_USERNAME=
KAFKA_PASSWORD=
SECURITY=
```