From d5224f87d41ca16b564b10366d8f298b3216054e Mon Sep 17 00:00:00 2001 From: Xiaoxin Lu Date: Mon, 13 Nov 2017 17:07:03 -0500 Subject: [PATCH] Doc fixes (#801) * Fixes #799 * Add example documentation KafkaClient usage to address #666 --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 3b9ea927..ceb4e5c8 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,12 @@ New KafkaClient connects directly to Kafka brokers instead of connecting to zook * `idleConnection` : allows the broker to disconnect an idle connection from a client (otherwise the clients continues to reconnect after being disconnected). The value is elapsed time in ms without any data written to the TCP socket. default: 5 minutes * `maxAsyncRequests` : maximum async operations at a time toward the kafka cluster. default: 10 +### Example + +```javascript +const client = new kafka.KafkaClient({kafkaHost: '10.3.100.196:9092'}); +``` + ## Client ### Client(connectionString, clientId, [zkOptions], [noAckBatchOptions], [sslOptions]) * `connectionString`: Zookeeper connection string, default `localhost:2181/` @@ -365,6 +371,7 @@ consumerGroup.pipe(messageTransform).pipe(resultProducer); { topic: 'topicName', offset: 0, //default 0 + partition: 0 // default 0 } ```