-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support committing an array of topic partitions
- Loading branch information
1 parent
5780247
commit cfc237b
Showing
4 changed files
with
112 additions
and
53 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
var KafkaConsumer = require('./').KafkaConsumer; | ||
var crypto = require('crypto'); | ||
|
||
var consumer = new KafkaConsumer({ | ||
'bootstrap.servers': 'localhost:9092', | ||
'group.id': 'kafka-mocha-grp-' + crypto.randomBytes(20).toString('hex'), | ||
'debug': 'all', | ||
'rebalance_cb': true, | ||
'enable.auto.commit': false | ||
}, {}); | ||
|
||
var topic = 'test'; | ||
|
||
consumer.connect({ timeout: 2000 }, function(err, info) { | ||
consumer.commit([{ topic: topic, partition: 0, offset: -1 }]); | ||
|
||
consumer.disconnect(function() { | ||
|
||
}); | ||
}); |