-
Notifications
You must be signed in to change notification settings - Fork 52
/
config.js
66 lines (59 loc) · 1.29 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
"use strict";
const config = {
/*logger: {
debug: console.log,
info: console.log,
warn: console.log,
error: console.log
}, */
options: {
pollIntervalMs: 100,
consumeGraceMs: 22,
murmurHashVersion: "2"
}
};
const producerConfig = Object.assign({}, config, {
noptions: {
"client.id": "n-test-producer",
"metadata.broker.list": "localhost:9092",
//"debug": "all",
"dr_cb": true,
"event_cb": true,
"compression.codec": "snappy",
"retry.backoff.ms": 200,
"message.send.max.retries": 10,
"socket.keepalive.enable": true,
"queue.buffering.max.messages": 100000,
"queue.buffering.max.ms": 1000,
"batch.num.messages": 1000000
}
});
const consumerConfig = Object.assign({}, config, {
noptions: {
"metadata.broker.list": "localhost:9092",
"group.id": "n-test-group",
"enable.auto.commit": false,
//"debug": "all",
"event_cb": true
}
});
const jsProducerConfig = {
kafkaHost: "localhost:9092",
clientName: "n-test-producer-js",
options: {}
};
const jsConsumerConfig = {
kafkaHost: "localhost:9092",
groupId: "n-test-group-js",
options: {
autoCommit: true
}
};
const topic = "n-test-topic";
module.exports = {
producerConfig,
consumerConfig,
jsProducerConfig,
jsConsumerConfig,
topic
};