This commit is contained in:
2020-10-28 16:25:22 +08:00
parent 2b5ff64c64
commit e097ed6129
+1 -1
View File
@@ -102,7 +102,7 @@ class Producer extends Component
$this->error(sprintf("Kafka error: %s (reason: %s)", rd_kafka_err2str($err), $reason));
});
$rk = new \RdKafka\Producer($this->conf);
$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);