I am trying to use docker to deploy my app, and I write the following docker-compose. I ran the docker-compose up -d, however, I get the following error:
ERROR [Connection] Connection error: connect ECONNREFUSED 127.0.0.1:29092 {\"timestamp\":\"2021-11-30T02:14:08.389Z\",\"logger\":\"kafkajs\",\"broker\":\"localhost:29092\",\"clientId\":\"nestjs-consumer-server\",\"stack\":\"Error: connect ECONNREFUSED 127.0.0.1:29092\\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16)\"}"}
notification-center-web-1 | {"level":"error","message":"ERROR [BrokerPool] Failed to connect to seed broker, trying another broker from the list: Connection error: connect ECONNREFUSED 127.0.0.1:29092 {\"timestamp\":\"2021-11-30T02:14:08.389Z\",\"logger\":\"kafkajs\",\"retryCount\":1,\"retryTime\":624}"}
I have tried different ports but still can not work. I am wondering how to connect my web app and the kafka so that I can send messages on a topic. localhost:8080 (kafka_ui) can work, and it shows that CLUSTERS are online.
Please help