1.0.6 • Published 3 years ago
@tcf_team/send-json-to-kafka-queue v1.0.6
Publish list of object to kafka
Install
yarn add @tcf_team/send-json-to-kafka-queue
# or
npm install --save @tcf_team/send-json-to-kafka-queue
Configuring
The location of kafka can be set by the environment variable:
KAFKA_URL=localhost:9092 # default
Example usage
const {sendToKafka} = require('send-to-kafka');
const exampleFunction = async () => {
const somethingToAddInsideEachMessage = 'what you want string, object, list, number';
const listOfMessageJSON = [
{key: 'value', key2: 'value2'},
{key: 'value', something: 'value'}
];
await sendToKafka('topic', somethingToAddInsideEachMessage, listOfMessageJSON)
};
exampleFunction().then(() => {console.log('Everything is sent')});
Debugging
This package uses the debug package. You can configure it with environment variables:
DEBUG=send-to-kafka:debug # only debug messages
DEBUG=send-to-kafka:trace # only trace messages
DEBUG=send-to-kafka:* # every messages
1.0.6
3 years ago
1.0.5-beta1
3 years ago
1.0.5-beta
3 years ago
1.0.4
3 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago