We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3c402ce + 3230d80 commit fa01ae0Copy full SHA for fa01ae0
src/init.js
@@ -16,10 +16,18 @@ const models = require('./models');
16
async function configureKafkaConsumer(handlers) {
17
18
// create group consumer
19
- const options = { brokers: config.KAFKA_URL.split(',') };
+ let brokers = ['']
20
+ if (config.KAFKA_URL.startsWith('ssl://')) {
21
+ brokers = config.KAFKA_URL.split('ssl://')[1].split(',')
22
+ } else {
23
+ brokers = config.KAFKA_URL.split(',')
24
+ }
25
+ const options = { brokers };
26
if (config.KAFKA_CLIENT_CERT && config.KAFKA_CLIENT_CERT_KEY) {
27
options.ssl = { cert: config.KAFKA_CLIENT_CERT, key: config.KAFKA_CLIENT_CERT_KEY };
28
}
29
+
30
31
const kafka = new Kafka(options)
32
const consumer = kafka.consumer({ groupId: config.KAFKA_GROUP_ID });
33
await consumer.connect()
0 commit comments