I use kafkajs for autotests.
When calling await consumer.disconnect()
- the command takes about 5 seconds, are there any options for a safe and fast disconnect?
const consumer = this.client.consumer({
groupId: this.groupId,
heartbeatInterval: this.heartbeatInterval,
sessionTimeout: this.sessionTimeout,
});
await consumer.connect();
await consumer.subscribe({ topics: [topic], fromBeginning });
await consumer.run({...});
await this.disconnect(consumer);