Skip to content
JM.
All posts

kafka · nodejs · performance

Why your Kafka consumer lags

2026.09.02 · 1 min read · Jeet Mendpara

DUMMY CONTENT. Replace before launch. Target 1200 words.

Placeholder opening. Specific, not "in today's fast-paced world".

What lag actually measures

Placeholder.

const consumer = kafka.consumer({ groupId: "orders" });
await consumer.run({
  eachBatch: async ({ batch, resolveOffset, heartbeat }) => {
    for (const message of batch.messages) {
      await handle(message);
      resolveOffset(message.offset);
      await heartbeat();
    }
  },
});

The three causes

Placeholder — slow handler, partition skew, rebalance storms.

Fixing it

Placeholder.

What I'd check first

Placeholder.