Demonstration of Node JS connection to cloudkarafka with data aggregator.
The app produces data sets of user event details into a kafka topic based on following parameters on 'app.js'
- uniqueUsers
- maxRecordsPerUser
Then consume the topic and aggregate the result upon incoming message based on user event's timestamp to determine a user's first seen and last seen timestamp.
First, install the dependencies of the app by running
npm install
Then running the app by following command
npm start
or select a different environment specified in config.js
by using following command:
node app.js <environment>
e.g. (See environment preset in 'config.js'):
node app.js live
The app is tested in following environment:
- Node.js v10.14.1
- NPM 6.4.1
- node-rdkafka ^2.4.2
Optional:
- kafkacat
MIT