This commit is contained in:
2020-10-28 16:10:23 +08:00
parent f05e459be6
commit b943a7af8a
2 changed files with 11 additions and 3 deletions
+1 -3
View File
@@ -108,9 +108,7 @@ class Producer extends Component
$rk = new \RdKafka\Producer();
$topic = $rk->newTopic($this->_topic, $this->topicConf);
$topic->produce(RD_KAFKA_PARTITION_UA, 0, $message, $key);
if ($rk->getOutQLen() > 0) {
$rk->poll($timeout);
}
$rk->poll($timeout);
$rk->flush($timeout);
}
}