kafka-node
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -11,6 +11,7 @@ 'use strict'; | ||
var Client = function (connectionString, clientId) { | ||
var Client = function (connectionString, clientId, zkOptions) { | ||
if (this instanceof Client === false) return new Client(connectionString, clientId); | ||
this.connectionString = connectionString || 'localhost:2181/kafka0.8'; | ||
this.clientId = clientId || 'kafka-node-client'; | ||
this.zkOptions = zkOptions; | ||
this.brokers = {} | ||
@@ -28,3 +29,3 @@ this.topicMetadata = {}; | ||
Client.prototype.connect = function () { | ||
var zk = this.zk = new Zookeeper(this.connectionString); | ||
var zk = this.zk = new Zookeeper(this.connectionString, this.zkOptions); | ||
var self = this; | ||
@@ -31,0 +32,0 @@ zk.once('init', function (broker) { |
@@ -12,6 +12,4 @@ 'use strict'; | ||
*/ | ||
var Zookeeper = function (connectionString) { | ||
this.client = zookeeper.createClient( | ||
connectionString || 'localhost:2181/kafka0.8' | ||
); | ||
var Zookeeper = function (connectionString, options) { | ||
this.client = zookeeper.createClient(connectionString,options); | ||
@@ -18,0 +16,0 @@ var that = this; |
{ | ||
"name": "kafka-node", | ||
"description": "node client for Apache kafka, only support kafka 0.8 and above", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"main": "kafka.js", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
@@ -16,5 +16,6 @@ Kafka-node | ||
## Client | ||
### Client(connectionString, clientId) | ||
* `connectionString`: zookeeper connection string, default `localhost:2181/kafka0.8` | ||
### Client(connectionString, clientId, [zkOptions]) | ||
* `connectionString`: Zookeeper connection string, default `localhost:2181/kafka0.8` | ||
* `clientId`: This is a user supplied identifier for the client application, default `kafka-node-client` | ||
* `zkOptions`: **Object**, Zookeeper options, see [node-zookeeper-client](https://github.com/alexguan/node-zookeeper-client#client-createclientconnectionstring-options) | ||
@@ -21,0 +22,0 @@ ## Producer |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74151
293
1762