From d7097e46e5e7367e652d184c68d76d302a47c982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 28 Oct 2020 16:44:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Kafka/Producer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kafka/Producer.php b/Kafka/Producer.php index cf1bc4c2..aa894014 100644 --- a/Kafka/Producer.php +++ b/Kafka/Producer.php @@ -90,7 +90,7 @@ class Producer extends Component * @param int $timeout * @throws */ - public function delivery($message, $key = null, $timeout = 5) + public function delivery($message, $key = null, $timeout = 10) { if (!$this->conf || !$this->topicConf) { throw new \Exception('Error. Please set kafka conf.'); @@ -105,7 +105,7 @@ class Producer extends Component $rk = Snowflake::createObject(\RdKafka\Producer::class, [$this->conf]); $topic = $rk->newTopic($this->_topic, $this->topicConf); $topic->produce(RD_KAFKA_PARTITION_UA, 0, $message, $key); - $rk->poll($timeout); + $rk->poll(0); $rk->flush($timeout); } }