Skip to content

Commit d19611e

Browse files
Merge pull request #3 from cinemataztic/update-documentation
Documentation 2.0
2 parents 2a1ed6a + 8d0b9d5 commit d19611e

File tree

5 files changed

+1460
-27
lines changed

5 files changed

+1460
-27
lines changed

Diff for: README.md

+28-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,31 @@ const { KafkaClient } = require('@cinemataztic/big-evil-kafka');
2828

2929
Configurations must be passed to the KafkaClient in order to initialize node-rdkafka producer and consumer internally.
3030

31-
brokers needs to be passed as a string i.e `localhost:9092, kafka:29092`
31+
### `config`
32+
33+
- `clientId?: string`
34+
35+
The unique identifier of both producer and consumer instance. It is meant as a label and is not to be confused with the group ID.
36+
37+
Default value is `default-client`.
38+
39+
- `groupId?: string`
40+
41+
The unique identifier for a group of consumers that work together to consume messages from a set of Kafka topics.
42+
43+
Default value is `default-group-id`.
44+
45+
- `brokers?: Array`
46+
47+
The list of brokers that specifies the Kafka broker(s), the producer and consumer should connect to. Brokers needs to be passed as an array i.e `['localhost:9092', 'kafka:29092']` because the package internally converts them to string as per the requirement for node-rdkafka that requires `metadata.broker.list` as a string.
48+
49+
Default value is `['localhost:9092']`.
50+
51+
- `avroSchemaRegistry?: string`
52+
53+
The schema registry URL which helps in encoding and decoding the messages according to a specific avro schema in a subject.
54+
55+
Default value is `http://localhost:8081`.
3256

3357
```js
3458
const client = new KafkaClient({
@@ -49,7 +73,9 @@ client.sendMessage(topic, message);
4973

5074
## Consuming Messages
5175

52-
The package uses non-flowing consumer mode with `enable.auto.commit` enabled along with 'auto.offset.reset' set to earliest.
76+
The package uses non-flowing consumer mode with `enable.auto.commit` enabled along with `auto.offset.reset` set to earliest.
77+
78+
The messages are consumed at an interval of 1 second with 10 messages consumed at each interval.
5379

5480
To consume a message from a topic, provide the topic name and a callback function that would return the message.
5581

0 commit comments

Comments
 (0)