Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/kafkajs/_consumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ class Consumer {
const messagesPerMillisecondSingleWorker = this.#lastFetchedMessageCnt / this.#lastFetchedConcurrency / consumptionDurationMilliseconds;
// Keep enough messages in the cache for this.#maxCacheSizePerWorkerMs of concurrent consumption by all workers.
// Round up to the nearest multiple of `#maxBatchesSize`.
this.#messageCacheMaxSize = Math.ceil(
this.#messageCacheMaxSize = Math.ceil(1 +
Math.round(this.#maxCacheSizePerWorkerMs * messagesPerMillisecondSingleWorker) * this.#concurrency
/ this.#maxBatchesSize
) * this.#maxBatchesSize;
Expand Down