Skip to content

Instantly share code, notes, and snippets.

@thakursaurabh1998
Last active August 9, 2020 15:26
Show Gist options
  • Save thakursaurabh1998/3489b09b3e64fd640a5ef2c74e324310 to your computer and use it in GitHub Desktop.
Save thakursaurabh1998/3489b09b3e64fd640a5ef2c74e324310 to your computer and use it in GitHub Desktop.
Kafka Throttle
const { ConsumerGroup } = require('kafka-node');
const options = {
kafkaHost: 'broker:9092',
groupId: 'order-service',
};
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