npm.io
6.2.0 • Published 6 years ago

toto-event-consumer

Licence
ISC
Version
6.2.0
Deps
4
Size
9 kB
Vulns
0
Weekly
0

Toto Event Consumer

This is a npm library to be used to consume from a Kafka topic.

When including this through require(), a new TotoEventConsumer instance will be automatically created and it will be possible to consume events from kafka.

Typical usage:

var TotoEventConsumer = require('toto-event-consumer');
var eventConsumer = new TotoEventConsumer(microserviceName, topic, (event) => {});

Example:

var TotoEventConsumer = require('toto-event-consumer');
var eventConsumer = new TotoEventConsumer('react-training-nssex', 'trainingSessionsCreated', (event) => {});

NOTE! that the event that is being passed in the callback has already been parsed and is in JSON format!