kafka-php icon indicating copy to clipboard operation
kafka-php copied to clipboard

(The consumers at 2.12, 1.0.0 can't read the data)2.12 1.0.0 的消费者无法读取数据

Open momozi-coder opened this issue 8 years ago • 7 comments

The consumers at 2.12, 1.0.0 can't read the data, and the producer can send the data, and the whole process appears to be dead when the user is using it, and it never responds.

2.12 1.0.0 的消费者无法读取数据,生产者可以发送数据的,当使用消费者的时候整个进程出现卡死状态,一直没有反应。

momozi-coder avatar Dec 21 '17 02:12 momozi-coder

@huyouheng can you provide more details on this? Like you test code, etc

nmred avatar Dec 21 '17 05:12 nmred

`require './vendor/autoload.php'; date_default_timezone_set('PRC'); use Monolog\Logger; use Monolog\Handler\StreamHandler;

$config = \Kafka\ConsumerConfig::getInstance(); $config->setMetadataRefreshIntervalMs(10000); $config->setMetadataBrokerList('127.0.0.1:9092'); $config->setGroupId('test'); $config->setBrokerVersion('1.0.0'); $config->setTopics(array('test')); //$config->setOffsetReset('earliest'); $consumer = new \Kafka\Consumer(); $consumer->setLogger($log); $consumer->start(function($topic, $part, $message) { var_dump($message); }); ` PHP 7.2.0 (cli) (built: Dec 13 2017 17:54:19) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies

consumers can't read the data 。

momozi-coder avatar Dec 28 '17 01:12 momozi-coder

@huyouheng kafka-php version is v0.2.0.8?

nmred avatar Dec 28 '17 02:12 nmred

kafka version is kafka_2.12-1.0.0.tgz。kafka-php version is "nmred/kafka-php": "v0.2.0.8",

momozi-coder avatar Dec 28 '17 05:12 momozi-coder

You can runing this example https://github.com/weiboad/kafka-php/blob/v0.2.0.8/example/protocol/MetaData.php get kafka cluster broker info, check broker host and port is it possible to connect?

nmred avatar Dec 28 '17 06:12 nmred

Thank you, I'll try。

momozi-coder avatar Dec 28 '17 14:12 momozi-coder

Hi,

I am also having this problem. I use docker run the kafka service. Kafka is from wurstmeister/kafka:1.1.0 image and zookeeper is from zookeeper:3.4 image. kafka-php version is "dev-master".

I have tried the code in the MetaData.php example and I am able to connect. The producer actually works and I can confirm the produced messages via command-line consumer. It is just that the consumer never receives new messages.

jsantoso avatar May 25 '18 08:05 jsantoso