Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

setMaxBytes #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
14 changes: 14 additions & 0 deletions src/ConsumerConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,18 @@ public function getConsumeMode(): int
{
return $this->runtimeOptions['consume_mode'];
}

/**
* @param int $maxBytes
*
* @throws \Kafka\Exception\Config
*/
public function setMaxBytes(int $maxBytes): void
{
if ($maxBytes < 1000 || $maxBytes > 1000000000) {
throw new Exception\Config('Set consumer maxBytes value is invalid, must set it 1000 .. 1000000000');
}

static::$options['maxBytes'] = $maxBytes;
}
}