https://github.com/tsmx/kafkajs-file-producer
File-producer project for the "Using Apache Kafka for transferring files" tutorial
https://github.com/tsmx/kafkajs-file-producer
apache-kafka file-transfer kafka kafkajs
Last synced: 5 months ago
JSON representation
File-producer project for the "Using Apache Kafka for transferring files" tutorial
- Host: GitHub
- URL: https://github.com/tsmx/kafkajs-file-producer
- Owner: tsmx
- License: mit
- Created: 2025-04-14T18:33:25.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-04-28T19:08:02.000Z (5 months ago)
- Last Synced: 2025-04-28T20:23:42.058Z (5 months ago)
- Topics: apache-kafka, file-transfer, kafka, kafkajs
- Language: JavaScript
- Homepage: https://tsmx.net/using-apache-kafka-for-transferring-files/
- Size: 2.49 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KafkaJS file producer
Producer example for the [Using Apache Kafka for transferring files](https://tsmx.net/using-apache-kafka-for-transferring-files/) article.
Uses the [KafkaJS](https://kafka.js.org/) library for Kafka client functionality.
## Usage
First, [get Kafka up & running](https://tsmx.net/using-apache-kafka-for-transferring-files/#Getting_Kafka_up_running) and [create an appropriate topic](https://tsmx.net/using-apache-kafka-for-transferring-files/#Creating_a_topic) as described in the tutorial.
To produce file messages, simply start the producer app and pass the desired file as an argument. Two example files are provided in the `samples/` directory.
```bash
$ node app.js ./samples/example.jpg
File ./samples/example.jpg sent. (2690215 Bytes)
```The corresponding [consumer example](https://github.com/tsmx/kafkajs-file-consumer) is also available.