-
Notifications
You must be signed in to change notification settings - Fork 52
/
config.js
75 lines (69 loc) · 2.02 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
67
68
69
70
71
72
73
74
75
const debug = require("debug");
const path = require("path");
const logger = {
debug: debug("sinek:debug"),
info: debug("sinek:info"),
warn: debug("sinek:warn"),
error: debug("sinek:error")
};
const consumerConfig = {
logger,
noptions: {
//"debug": "all",
"metadata.broker.list": "localhost:9193",
"group.id": "example-group",
"enable.auto.commit": false,
"event_cb": true,
"compression.codec": "none",
"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,
"security.protocol": "sasl_ssl",
"ssl.key.location": path.join(__dirname, "../certs/ca-key"),
"ssl.key.password": "nodesinek",
"ssl.certificate.location": path.join(__dirname,"../certs/ca-cert"),
"ssl.ca.location": path.join(__dirname,"../certs/ca-cert"),
"sasl.mechanisms": "PLAIN",
"sasl.username": "admin",
"sasl.password": "nodesinek",
"api.version.request": true,
},
tconf: {
"auto.offset.reset": "earliest"
}
};
const producerConfig = {
logger,
noptions: {
//"debug": "all",
"metadata.broker.list": "localhost:9193",
"client.id": "example-client",
"event_cb": true,
"compression.codec": "none",
"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,
"security.protocol": "sasl_ssl",
"ssl.key.location": path.join(__dirname, "../certs/ca-key"),
"ssl.key.password": "nodesinek",
"ssl.certificate.location": path.join(__dirname,"../certs/ca-cert"),
"ssl.ca.location": path.join(__dirname,"../certs/ca-cert"),
"sasl.mechanisms": "PLAIN",
"sasl.username": "admin",
"sasl.password": "nodesinek",
"api.version.request": true,
},
tconf: {
"request.required.acks": 1
}
};
module.exports = {
consumerConfig,
producerConfig
};