Created
August 9, 2020 15:26
-
-
Save thakursaurabh1998/a554f3526122e83cbb3961fe22b891ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { ConsumerGroup } = require('kafka-node'); | |
const options = { | |
kafkaHost: 'broker:9092', | |
groupId: 'order-service', | |
fetchMaxBytes: 100 * 1024, // 100 KB | |
autoCommit: false, | |
}; | |
const consumer = new ConsumerGroup(options, 'OrderTopic'); | |
consumer.on('message', (data) => { | |
// queue data available here | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment