Permalink
Browse files

document and default groupId

  • Loading branch information...
1 parent d7632f7 commit 1e812fd7541c6aa9d73697ddad9efc461ff01391 @dannycoates committed Nov 14, 2012
Showing with 4 additions and 2 deletions.
  1. +3 −2 kafka.js
  2. +1 −0 readme.md
View
5 kafka.js
@@ -17,11 +17,13 @@ module.exports = function (
// maxMessageSize: -1
// queueTime: 5000
// batchSize: 200
+ // groupId: 'franz-kafka'
// }
//
function Kafka(options) {
this.topics = {}
this.options = options || {}
+ this.options.groupId = this.options.groupId || 'franz-kafka'
this.connector = null
this.topicDefaults = this.defaultOptions(options)
EventEmitter.call(this)
@@ -109,13 +111,12 @@ module.exports = function (
//
// }
Kafka.prototype.topic = function (name, options) {
- options = setTopicOptions(options, this.topicDefaults)
var topic = this.topics[name] ||
new Topic(
name,
this.connector.producer,
this.connector.consumer,
- options
+ setTopicOptions(options, this.topicDefaults)
)
this.topics[name] = topic
return topic
View
1 readme.md
@@ -72,6 +72,7 @@ var kafka = new Kafka({
batchSize: 200, // number of messages to bundle before producing
// consumer defaults
+ groupId: 'franz-kafka', // the consumer group name this instance is part of
minFetchDelay: 0, // minimum milliseconds to wait between fetches
maxFetchDelay: 10000, // maximum milliseconds to wait between fetches
maxFetchSize: 300*1024, // limits the size of a fetched message

0 comments on commit 1e812fd

Please sign in to comment.