From c110831d653020c04517b339ebc2fbf7efaa64d0 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Wed, 16 Mar 2022 00:52:24 +0000 Subject: [PATCH 1/2] Fix: Add dockerfile to base folder --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9c43b55..edf296c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,4 +7,5 @@ RUN yarn cache clean COPY src /opt/uci WORKDIR /opt/uci RUN yarn -i -CMD ["node", "app.js", "&"] \ No newline at end of file +RUN yarn global add pm2 +CMD ["pm2-runtime", "app.js"] \ No newline at end of file From 418d680970dde019d8cafef97c13641c94bca7ed Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Mon, 28 Mar 2022 17:29:17 +0530 Subject: [PATCH 2/2] Udpate kafka broker fix --- src/helpers/kafkaUtil.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/helpers/kafkaUtil.js b/src/helpers/kafkaUtil.js index 18d9e57..0de7388 100644 --- a/src/helpers/kafkaUtil.js +++ b/src/helpers/kafkaUtil.js @@ -8,9 +8,14 @@ if (process.env.ENV === "dev") { brokers: [`${process.env.KAFKA_HOST_DEV}`], }); } else { - const brokers = process.env.KAFKA_HOST.split(",").map( - (s) => s + ":" + process.env.KAFKA_PORT - ); + let brokers = process.env.KAFKA_HOST; + if(process.env.KAFKA_HOST.includes("9092")){ + console.log("Kafka brokers have PORT"); + }else { + brokers = process.env.KAFKA_HOST.split(",").map( + (s) => s + ":" + process.env.KAFKA_PORT + ); + } console.log(`Trying to connect to ${brokers}`); kafka = new Kafka({ clientId: "api",