I have three brokers running on 9002, 9003 and 9004 port . Now i am using kafkajs npm library to create a consumer. Now in the ideal scenario when all the brokers are down at that time i am getting below error -
{"level":"ERROR","timestamp":"2023-03-17T15:07:06.849Z","logger":"kafkajs","message":"[Consumer] Crash: KafkaJSNonRetriableError: Connection error: connect ECONNREFUSED 127.0.0.1:9094","groupId":"groupId","stack":"KafkaJSNonRetriableError: Connection error: connect ECONNREFUSED 127.0.0.1:9094\n at /Users/vn54q4d/projects/path/node_modules/kafkajs/src/retry/index.js:53:18\n at processTicksAndRejections (node:internal/process/task_queues:96:5)"}
and my consumer shut down and stop consuming the data from topic. So actually i want to solve that if after some time all of my broker are again up and running then either ,
- consumer should automatically get started and start consuming the data in the queue, or
- consumer should not shutdown when all the brokers are down.