Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 31536c3

Browse files
author
Paweł Niedzielski
committedMay 13, 2019
Fix consumption errors in kafka against recent versions in librdkafka/phprdkafka
Recent versions may no longer return error message when reaching end of partition (RD_KAFKA_RESP_ERR__PARTITION_EOF - due to change in `enable.partition.eof`). This is especially true for librdkafka >=1.0.0. see arnaud-lb/php-rdkafka#220 (comment)
1 parent 51fa82c commit 31536c3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎pkg/rdkafka/RdKafkaConsumer.php

+4
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ private function doReceive(int $timeout): ?RdKafkaMessage
155155
{
156156
$kafkaMessage = $this->consumer->consume($timeout);
157157

158+
if ($kafkaMessage === null) {
159+
return null;
160+
}
161+
158162
switch ($kafkaMessage->err) {
159163
case RD_KAFKA_RESP_ERR__PARTITION_EOF:
160164
case RD_KAFKA_RESP_ERR__TIMED_OUT:

0 commit comments

Comments
 (0)
Please sign in to comment.