Skip to content

Commit

Permalink
Merge pull request #1 from ClamorousKun/master
Browse files Browse the repository at this point in the history
修复连接超时时message返回空的问题 感谢@ClamorousKun 帮助修复
  • Loading branch information
wenzhenxi authored Apr 1, 2017
2 parents 5917f1b + 6dcbf57 commit 326b288
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Consumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ public function consumerStop() {
*/
public function consume() {
$message = $this->topic->consume($this->partition, $this->timeout * 1000);

if (empty($message)) {
return null;
}

switch ($message->err) {
case RD_KAFKA_RESP_ERR_NO_ERROR:
return $message;
Expand Down

0 comments on commit 326b288

Please sign in to comment.