I am using the kafkaJS library to connect Kafka consumer, below is the configuration
private createKafkaConsumer(): Consumer {
const kafka = new Kafka({
logLevel: logLevel.WARN,
brokers: this.kafkaHost,
connectionTimeout: 10000,
requestTimeout: 25000,
retry: {
initialRetryTime: 100,
retries: 8,
},
});
const consumer = kafka.consumer({
groupId: this.groupId,
sessionTimeout: 60000,
rebalanceTimeout: 60000,
heartbeatInterval: 3000,
allowAutoTopicCreation: false,
maxWaitTimeInMs: 5000,
maxBytes: 1024 * 10
});
return consumer;
}
I am getting this error
{"level":"ERROR","timestamp":"2022-10-16T12:29:57.236Z","logger":"kafkajs","message":"[Connection] Response Fetch(key: 1, version: 10)","broker":"b-1.ccss-prod-pulse-msk.5jyfxf.c3.kafka.ap-south-1.amazonaws.com:9092","clientId":"kafkajs","error":"This server is not the leader for that topic-partition","correlationId":2301,"size":162}
{"level":"ERROR","timestamp":"2022-10-16T12:29:57.258Z","logger":"kafkajs","message":"[Connection] Response Fetch(key: 1, version: 10)","broker":"b-1.ccss-prod-pulse-msk.5jyfxf.c3.kafka.ap-south-1.amazonaws.com:9092","clientId":"kafkajs","error":"This server is not the leader for that topic-partition","correlationId":2302,"size":162}
{"level":"ERROR","timestamp":"2022-10-16T12:29:57.275Z","logger":"kafkajs","message":"[Connection] Response Fetch(key: 1, version: 10)","broker":"b-1.ccss-prod-pulse-msk.5jyfxf.c3.kafka.ap-south-1.amazonaws.com:9092","clientId":"kafkajs","error":"This server is not the leader for that topic-partition","correlationId":2303,"size":162}
{"level":"ERROR","timestamp":"2022-10-16T12:29:57.331Z","logger":"kafkajs","message":"[Connection] Response OffsetCommit(key: 8, version: 5)","broker":"b-2.ccss-prod-pulse-msk.5jyfxf.c3.kafka.ap-south-1.amazonaws.com:9092","clientId":"kafkajs","error":"Specified group generation id is not valid","correlationId":6017,"size":86}
{"level":"ERROR","timestamp":"2022-10-16T12:29:57.334Z","logger":"kafkajs","message":"[Connection] Response Fetch(key: 1, version: 10)","broker":"b-1.ccss-prod-pulse-msk.5jyfxf.c3.kafka.ap-south-1.amazonaws.com:9092","clientId":"kafkajs","error":"This server is not the leader for that topic-partition","correlationId":2304,"size":162}
{"level":"ERROR","timestamp":"2022-10-16T12:29:59.872Z","logger":"kafkajs","message":"[Consumer] Crash: KafkaJSNonRetriableError: Specified group generation id is not valid","groupId":"in-EW-Maintenance-Hourmeter.1","stack":"KafkaJSNonRetriableError: Specified group generation id is not valid\n at /usr/src/app/node_modules/kafkajs/src/retry/index.js:55:18\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:94:5)"}
[root@ip-10-213-116-19 ~]#
have anyone come across this issue?