Open airanvinay opened 7 years ago
Would you please paste your code?
I got same error, too.
PHP Warning: array_merge(): Argument #1 is not an array in /app/test_kafka/mq/vendor/nmred/kafka-php/src/Kafka/Produce.php on line 136 PHP Warning: Zookeeper::exists(): error: invalid zhandle state in /app/test_kafka/mq/vendor/nmred/kafka-php/src/Kafka/ZooKeeper.php on line 208
my code:
$queue = msg_get_queue( $queue_id );
$msg_type = NULL;
$msg = NULL;
$max_msg_size = 16384;
$kafka = \Kafka\Produce::getInstance(KAFKA_SERVER, KAFKA_TIMEOUT);
$kafka->setRequireAck(-1);
while( msg_receive($queue, 1, $msg_type, $max_msg_size, $msg) )
{
$msg->mq_data[ 'ymd' ] = date( 'Ymd' );
$json_data = json_encode( $msg->mq_data );
try {
$kafka->setMessages(TEST_KAFKA_TOPIC_PREFIX.date('Ymd'), rand(0,99), $json_data);
$kafka->send();
$kafka->setMessages(TEST_KAFKA_TOPIC_CURRENT, rand(0,99), $json_data);
$kafka->send();
} catch( \Exception $e ) {
echo "...failed, passed.\n";
}
$msg_type = NULL;
$msg = NULL;
}
If you use latest version of pecl/zookeeper, you will get an exception when ' invalid zhandle state' occurs.
You can contact the author of nmred/kafka-php
to catch this exception.
Can we close this issue now? : )
Sure. ;p
Getting Exception "Zookeeper::exists(): error: invalid zhandle state", I am using Zookeeper for Kafka. Need help to find out where i am wrong.