File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,18 @@ const models = require('./models');
16
16
async function configureKafkaConsumer ( handlers ) {
17
17
18
18
// create group consumer
19
- const options = { brokers : config . KAFKA_URL . split ( ',' ) } ;
19
+ 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 } ;
20
26
if ( config . KAFKA_CLIENT_CERT && config . KAFKA_CLIENT_CERT_KEY ) {
21
27
options . ssl = { cert : config . KAFKA_CLIENT_CERT , key : config . KAFKA_CLIENT_CERT_KEY } ;
22
28
}
29
+
30
+
23
31
const kafka = new Kafka ( options )
24
32
const consumer = kafka . consumer ( { groupId : config . KAFKA_GROUP_ID } ) ;
25
33
await consumer . connect ( )
You can’t perform that action at this time.
0 commit comments