Skip to content

Commit

Permalink
修复连接超时时message返回空的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
焜 刘 committed Apr 1, 2017
1 parent 5917f1b commit 6dcbf57
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 6dcbf57

Please sign in to comment.