Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to decode later #17

Merged
merged 6 commits into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'master' into feat/JMP-2328/possibility-to-decode-later
  • Loading branch information
nick-zh committed Apr 23, 2020
commit e24d500f3dfb18ffdcf78d7d403a11f1c48fb356
3 changes: 2 additions & 1 deletion src/Consumer/AbstractKafkaConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ public function getConfiguration(): array
* Consumes a message and returns it
* In cases of errors / timeouts an exception is thrown
*
* @param integer $timeoutMs
* @param boolean $autoDecode
* @return KafkaConsumerMessageInterface
* @throws KafkaConsumerConsumeException
* @throws KafkaConsumerEndOfPartitionException
* @throws KafkaConsumerTimeoutException
*/
public function consume(bool $autoDecode = true): KafkaConsumerMessageInterface
public function consume(int $timeoutMs = 10000, bool $autoDecode = true): KafkaConsumerMessageInterface
{
if (false === $this->isSubscribed()) {
throw new KafkaConsumerConsumeException(KafkaConsumerConsumeException::NOT_SUBSCRIBED_EXCEPTION_MESSAGE);
Expand Down
3 changes: 2 additions & 1 deletion src/Consumer/KafkaConsumerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ public function isSubscribed(): bool;
* Consumes a message and returns it
* In cases of errors / timeouts a KafkaConsumerConsumeException is thrown
*
* @param integer $timeoutMs
* @param boolean $autoDecode
* @return KafkaConsumerMessageInterface
*/
public function consume(bool $autoDecode = true): KafkaConsumerMessageInterface;
public function consume(int $timeoutMs = 10000, bool $autoDecode = true): KafkaConsumerMessageInterface;

/**
* Decode consumer message
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.