Node.js Kafka consumer dropping Genesys notification events

Running a Node.js script to consume Genesys notification events from Kafka. The topic gets populated, but my consumer only sees half the messages. No errors in the logs. Just silent drops. I’m using kafkajs with autoCommit: true. Here’s the relevant setup:

const consumer = kafka.consumer({ groupId: 'genesys-notif' });
await consumer.subscribe({ topic: 'genesys.notifications', fromBeginning: true });

The payload looks fine when I inspect it directly in the broker. Is there a known issue with message batching or acks on the GC side? Or am I missing a config flag in kafkajs?

Disable autoCommit. It commits based on time, not processing completion. If your handler is slow, Kafka thinks you’re done before you are. Switch to manual commit after parsing.

await consumer.run({
 eachMessage: async ({ topic, partition, message }) => {
 // process
 await consumer.commitOffsets([{ topic, partition, offset: message.offset }]);
 }
});

Check your consumer lag metrics in the Genesys admin UI to verify.