改名
This commit is contained in:
+3
-4
@@ -56,11 +56,10 @@ class Kafka extends \Snowflake\Process\Process
|
|||||||
{
|
{
|
||||||
$this->channelListener();
|
$this->channelListener();
|
||||||
[$config, $topic, $conf] = $this->kafkaConfig();
|
[$config, $topic, $conf] = $this->kafkaConfig();
|
||||||
$objRdKafka = new \RdKafka\Consumer($config);
|
$objRdKafka = new KafkaConsumer($config);
|
||||||
$topic = $objRdKafka->newTopic('test', $topic);
|
$objRdKafka->subscribe(['test']);
|
||||||
$topic->consumeStart(0, RD_KAFKA_OFFSET_STORED);
|
|
||||||
while (true) {
|
while (true) {
|
||||||
$message = $topic->consume(0, $conf['metadataRefreshIntervalMs'] ?? 1000);
|
$message = $objRdKafka->consume($conf['metadataRefreshIntervalMs'] ?? 1000);
|
||||||
if (empty($message)) {
|
if (empty($message)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user